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
Fix failure message
Oliver Günther982ce8d25fb8
diff --git a/app/controllers/omni_auth_login_controller.rb b/app/controllers/omni_auth_login_controller.rbindex bfc027e2289..62e8569c492 100644--- a/app/controllers/omni_auth_login_controller.rb+++ b/app/controllers/omni_auth_login_controller.rb@@ -56,7 +56,7 @@ class OmniAuthLoginController < ApplicationControllerdef failurelog_omniauth_failure- show_error I18n.t(:error_external_authentication_failed, message: omniauth_error)+ show_error I18n.t(:error_external_authentication_failed_message, message: omniauth_error)endprivatediff --git a/config/locales/en.yml b/config/locales/en.ymlindex f124410b7ef..ed270549ad5 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1748,7 +1748,7 @@ en:Can't rename "%{old_name}" to "%{new_name}" due to a conflict in the resulting menu itemwith the existing menu item "%{existing_caption}" (%{existing_identifier}).- error_external_authentication_failed: "An error occurred during external authentication: %{message}"+ error_external_authentication_failed_message: "An error occurred during external authentication: %{message}"error_attribute_not_highlightable: "Attribute(s) not highlightable: %{attributes}"events:diff --git a/spec/controllers/concerns/omniauth_login_spec.rb b/spec/controllers/omni_auth_login_controller_spec.rbsimilarity index 98%rename from spec/controllers/concerns/omniauth_login_spec.rbrename to spec/controllers/omni_auth_login_controller_spec.rbindex c5519cfd7b6..c894b27c17e 100644--- a/spec/controllers/concerns/omniauth_login_spec.rb+++ b/spec/controllers/omni_auth_login_controller_spec.rb@@ -29,7 +29,7 @@require "spec_helper"# Concern is included into AccountController and depends on methods available there-RSpec.describe OmniAuthLoginController, :skip_2fa_stage do # rubocop:disable RSpec/SpecFilePathFormat+RSpec.describe OmniAuthLoginController, :skip_2fa_stage dolet(:omniauth_strategy) { double("Google Strategy", name: "google") } # rubocop:disable RSpec/VerifiedDoubleslet(:omniauth_hash) doOmniAuth::AuthHash.new(@@ -477,9 +477,12 @@ RSpec.describe OmniAuthLoginController, :skip_2fa_stage do # rubocop:disable RSpenddescribe "Error occurs during authentication" do- it "redirects to login page" do+ it "display the error" do+ request.env["omniauth.error"] = "invalid_credentials"post :failure+expect(response).to redirect_to signin_path+ expect(flash[:error]).to include "invalid_credentials"endit "logs a warn message" dodiff --git a/spec/features/auth/omniauth_spec.rb b/spec/features/auth/omniauth_spec.rbindex c592662e983..fff0dc28c5b 100644--- a/spec/features/auth/omniauth_spec.rb+++ b/spec/features/auth/omniauth_spec.rb@@ -248,7 +248,7 @@ RSpec.describe "Omniauth authentication" doOmniAuth::FailureEndpoint.new(env).redirect_to_failureendvisit login_path- expect(page).to have_content(I18n.t(:error_external_authentication_failed))+ expect(page).to have_content(I18n.t(:error_external_authentication_failed_message, message: "Unknown error"))if defined? instructionsexpect(page).to have_content instructions