Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix specs for meeting token

Klaus Zanders736290af3d8e
diff --git a/app/controllers/my/access_tokens_controller.rb b/app/controllers/my/access_tokens_controller.rb
index 422dcb882ef..4569fbab69c 100644
--- a/app/controllers/my/access_tokens_controller.rb
+++ b/app/controllers/my/access_tokens_controller.rb
@@ -148,13 +148,13 @@ module My
# rubocop:disable Rails/ActionControllerFlashBeforeRender
result.on_success do
- flash[:notice] = t("my.access_token.revocation.ical_meeting.notice_success")
+ flash[:notice] = t("my.access_token.revocation.token/ical_meeting.notice_success")
end
result.on_failure do |r|
error = r.errors.map(&:message).join("; ")
Rails.logger.error("Failed to revoke ical meeting token ##{current_user.id}: #{error}")
- flash[:error] = t("my.access_token.ical_meeting.notice_failure", error:)
+ flash[:error] = t("my.access_token.recocation.token/ical_meeting.notice_failure", error:)
end
# rubocop:enable Rails/ActionControllerFlashBeforeRender
diff --git a/spec/features/users/my/access_tokens_spec.rb b/spec/features/users/my/access_tokens_spec.rb
index 453c3f76a36..d7478701fac 100644
--- a/spec/features/users/my/access_tokens_spec.rb
+++ b/spec/features/users/my/access_tokens_spec.rb
@@ -75,7 +75,7 @@ RSpec.describe "my access tokens", :js do
find_test_selector("create-api-token-button").click
within("dialog#api-created-dialog") do
- expect(page).to have_content "The Access token token has been generated"
+ expect(page).to have_content "The API token has been generated"
expect(page).to have_field("openproject_api_access_token", with: %r{[a-f0-9]{64}}, readonly: true)
click_on "Close"
end
@@ -239,7 +239,7 @@ RSpec.describe "my access tokens", :js do
end
end
- describe "iCal Meeting tokens" do
+ describe "iCal Meeting tokens", with_flag: { meeting_ical_subscription: true } do
context "when iCal access is disabled via global settings", with_settings: { ical_enabled: false } do
it "shows notice about disabled token" do
visit my_access_tokens_path
@@ -269,7 +269,7 @@ RSpec.describe "my access tokens", :js do
find_test_selector("create-api-token-button").click
within("dialog#ical_meeting-created-dialog") do
- expect(page).to have_content "The iCal Meeting subscription token has been generated"
+ expect(page).to have_content "An iCal meeting subscription token has been generated"
expect(page).to have_field("openproject_api_access_token",
with: %r{http(s?)://[^/]+/meetings/ical/[a-f0-9]{64}.ics},
readonly: true)
@@ -292,7 +292,7 @@ RSpec.describe "my access tokens", :js do
end
end
- expect(page).to have_content I18n.t("my.access_token.revocation.ical_meeting.notice_success")
+ expect(page).to have_content I18n.t("my.access_token.revocation.token/ical_meeting.notice_success")
User.current.reload
visit my_access_tokens_path