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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[56168] Fixed MyController specs
Andreas Pfohl169f4b46662a
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rbindex 662daef9417..368fff61f5f 100644--- a/app/controllers/my_controller.rb+++ b/app/controllers/my_controller.rb@@ -31,6 +31,7 @@ class MyController < ApplicationControllerinclude Accounts::UserPasswordChangeinclude ActionView::Helpers::TagHelperinclude OpTurbo::ComponentStream+ include FlashMessagesOutputSafetyHelperlayout "my"@@ -163,9 +164,16 @@ class MyController < ApplicationControllerresult = APITokens::CreateService.new(user: current_user).call(token_name: params[:token_api][:token_name])result.on_success do |r|- token = Primer::Beta::Text.new(font_weight: :bold).render_in(view_context) { r.result.plain_value }- message = "#{t('my.access_token.notice_reset_token', type: 'API')} #{token} #{t('my.access_token.token_value_warning')}"- flash[:primer_banner] = { message:, scheme: :success }+ flash[:primer_banner] = {+ scheme: :success,+ message: join_flash_messages(+ [+ t("my.access_token.notice_reset_token", type: "API"),+ Primer::Beta::Text.new(font_weight: :bold).render_in(view_context) { r.result.plain_value },+ t("my.access_token.token_value_warning")+ ]+ )+ }redirect_to action: "access_token"enddiff --git a/spec/controllers/my_controller_spec.rb b/spec/controllers/my_controller_spec.rbindex 2f39f345cf6..3e82458cc57 100644--- a/spec/controllers/my_controller_spec.rb+++ b/spec/controllers/my_controller_spec.rb@@ -309,8 +309,8 @@ RSpec.describe MyController donew_token = user.reload.api_tokens.lastexpect(new_token).to be_present- expect(flash[:info]).to be_present- expect(flash[:error]).not_to be_present+ expect(flash[:primer_banner]).to be_present+ expect(flash[:primer_banner]).to include(scheme: :success)expect(response).to redirect_to action: :access_tokenend@@ -327,8 +327,8 @@ RSpec.describe MyController donew_token = user.reload.api_tokens.lastexpect(new_token).not_to eq(key)expect(new_token.value).not_to eq(key.value)- expect(flash[:info]).to be_present- expect(flash[:error]).not_to be_present+ expect(flash[:primer_banner]).to be_present+ expect(flash[:primer_banner]).to include(scheme: :success)expect(response).to redirect_to action: :access_tokenend