Skip to content

Commit

Permalink
fix tests for the new verifier (coopdevs#156)
Browse files Browse the repository at this point in the history
* rename verifier

* fix tests from copies change
  • Loading branch information
microstudi committed May 11, 2023
1 parent 0b795c1 commit 3361585
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ en:
<li><b>Email and phone number:</b> Uses SMS verification. Participant's email must match the census and phone number will be predefined.</li>
</ul>
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 <a href="/system">/system</a>.
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 <a href="/system">/system</a>.
copy_setting: 'Copy ponderations and census from:'
create:
error: There was a problem creating the settings
Expand Down
9 changes: 5 additions & 4 deletions lib/decidim/action_delegator/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/system/decidim/action_delegator/census_vote_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]")
Expand All @@ -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]")
Expand All @@ -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]")
Expand Down

0 comments on commit 3361585

Please sign in to comment.