From 33615850e164e0254046031c26bd8cb6ffe44d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Verg=C3=A9s?= Date: Thu, 11 May 2023 18:30:48 +0200 Subject: [PATCH] fix tests for the new verifier (#156) * rename verifier * fix tests from copies change --- config/locales/en.yml | 6 +++--- lib/decidim/action_delegator/engine.rb | 9 +++++---- .../admin/admin_manages_settings_spec.rb | 2 +- spec/system/decidim/action_delegator/census_vote_spec.rb | 2 +- .../delegations_verifier_code_verification_spec.rb | 2 +- .../verifications/delegations_verifier_request_spec.rb | 8 ++++---- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 47aca9f9..81ebdaaf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -192,9 +192,9 @@ en:
  • Email and phone number: Uses SMS verification. Participant's email must match the census and phone number will be predefined.
  • check_verifier: - not_installed_html: It seems that the "Corporate Governance Verifier" authorization - method is not installed. You cannot use the integrated census without - it. Please install it at /system. + not_installed_html: It seems that the "Corporate Governance Verifier" + authorization method is not installed. You cannot use the integrated + census without it. Please install it at /system. copy_setting: 'Copy ponderations and census from:' create: error: There was a problem creating the settings diff --git a/lib/decidim/action_delegator/engine.rb b/lib/decidim/action_delegator/engine.rb index 37abb7ab..6d3216ab 100644 --- a/lib/decidim/action_delegator/engine.rb +++ b/lib/decidim/action_delegator/engine.rb @@ -57,10 +57,11 @@ class Engine < ::Rails::Engine initializer "decidim.user_menu" do Decidim.menu :user_menu do |menu| - menu.item t("vote_delegations", scope: "layouts.decidim.user_profile"), - decidim_action_delegator.user_delegations_path, - position: 5.0, - active: :exact + menu.add_item :vote_delegations, + t("vote_delegations", scope: "layouts.decidim.user_profile"), + decidim_action_delegator.user_delegations_path, + position: 5.0, + active: :exact end end end diff --git a/spec/system/decidim/action_delegator/admin/admin_manages_settings_spec.rb b/spec/system/decidim/action_delegator/admin/admin_manages_settings_spec.rb index 0d5a2976..c1ecc8e4 100644 --- a/spec/system/decidim/action_delegator/admin/admin_manages_settings_spec.rb +++ b/spec/system/decidim/action_delegator/admin/admin_manages_settings_spec.rb @@ -250,7 +250,7 @@ let(:available_authorizations) { [] } it "alerts with a message" do - expect(page).to have_content('"Delegation Verifier" authorization method is not installed') + expect(page).to have_content('"Corporate Governance Verifier" authorization method is not installed') end end diff --git a/spec/system/decidim/action_delegator/census_vote_spec.rb b/spec/system/decidim/action_delegator/census_vote_spec.rb index 6fb657a9..84c571a1 100644 --- a/spec/system/decidim/action_delegator/census_vote_spec.rb +++ b/spec/system/decidim/action_delegator/census_vote_spec.rb @@ -25,7 +25,7 @@ end shared_examples "requires verification" do - let(:text) { "you need to be authorized with \"Delegations Verifier\"" } + let(:text) { "you need to be authorized with \"Corporate Governance\"" } it "requires verification first" do expect(page).to have_content("VERIFY YOUR ACCOUNT TO VOTE") diff --git a/spec/system/decidim/action_delegator/verifications/delegations_verifier_code_verification_spec.rb b/spec/system/decidim/action_delegator/verifications/delegations_verifier_code_verification_spec.rb index 70749d23..027983fc 100644 --- a/spec/system/decidim/action_delegator/verifications/delegations_verifier_code_verification_spec.rb +++ b/spec/system/decidim/action_delegator/verifications/delegations_verifier_code_verification_spec.rb @@ -32,7 +32,7 @@ switch_to_host(organization.host) login_as user, scope: :user visit decidim_verifications.authorizations_path - click_link "Delegations Verifier" + click_link "Corporate Governance" end context "when code requested" do diff --git a/spec/system/decidim/action_delegator/verifications/delegations_verifier_request_spec.rb b/spec/system/decidim/action_delegator/verifications/delegations_verifier_request_spec.rb index f7b16e8e..685a6646 100644 --- a/spec/system/decidim/action_delegator/verifications/delegations_verifier_request_spec.rb +++ b/spec/system/decidim/action_delegator/verifications/delegations_verifier_request_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe "Delegations verifier request", type: :system do +describe "Corporate Governance Verifier request", type: :system do let!(:organization) do create(:organization, available_authorizations: ["delegations_verifier"]) end @@ -21,7 +21,7 @@ end it "Shows the required fields" do - expect(page).to have_content("Authorize with Delegations Verifier") + expect(page).to have_content("Authorize with Corporate Governance Verifier") within "#new_delegations_verifier_" do expect(page).to have_content("Email") expect(page).to have_selector("input[value='#{email}'][readonly]") @@ -39,7 +39,7 @@ let(:authorization_method) { :phone } it "Shows the required fields" do - expect(page).to have_content("Authorize with Delegations Verifier") + expect(page).to have_content("Authorize with Corporate Governance Verifier") within "#new_delegations_verifier_" do expect(page).not_to have_content("Email") expect(page).not_to have_selector("input[value='#{email}'][readonly]") @@ -64,7 +64,7 @@ let(:authorization_method) { :email } it "Shows the required fields" do - expect(page).to have_content("Authorize with Delegations Verifier") + expect(page).to have_content("Authorize with Corporate Governance Verifier") within "#new_delegations_verifier_" do expect(page).to have_content("Email") expect(page).to have_selector("input[value='#{email}'][readonly]")