Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed May 22, 2024
1 parent d4cb044 commit 0299817
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 42 deletions.
5 changes: 2 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ en:
needs_to_be_reattached: Needs to be reattached
decidim:
admin:
actions:
manage: Manage
shared:
gallery:
gallery_legend: Add an image gallery
Expand Down Expand Up @@ -589,7 +587,8 @@ en:
continue: Next
warnings:
no_elections_warning: There isn't any election scheduled.
no_scheduled_elections_warning: Currently, there are no scheduled elections, but here you can find all the past elections listed.
no_scheduled_elections_warning: Currently, there are no scheduled elections,
but here you can find all the past elections listed.
layouts:
decidim:
vocdoni_votes_header:
Expand Down
42 changes: 4 additions & 38 deletions spec/system/decidim/admin/admin_creates_wallet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,16 @@
expect(Decidim::Vocdoni::Wallet.count).to eq 1
end

context "when prod environment" do
before do
allow(Decidim::Vocdoni).to receive(:api_endpoint_env).and_return("prod")
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_name).and_return("Test reseller")
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_email).and_return("[email protected]")
end

it "shows the information about receiving coins" do
visit_steps_page

expect(page).to have_content("The usage of the Vocdoni platform has costs")
expect(page).to have_content("Test reseller")
expect(page).to have_css("input[value='#{wallet.private_key}']")
expected_href = "mailto:[email protected]?subject=Decidim Vocdoni Inquiry&body=Please provide a quote for the Vocdoni platform usage. My organization Vocdoni address is: 0x0000000000000000000000000000000000000000000000000000000000000001"
expect(page).to have_css("a[href='#{expected_href}']")
end
end

context "when stg environment" do
shared_context "with environment settings" do |env|
before do
allow(Decidim::Vocdoni).to receive(:api_endpoint_env).and_return("stg")
allow(Decidim::Vocdoni).to receive(:api_endpoint_env).and_return(env)
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_name).and_return("Test reseller")
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_email).and_return("[email protected]")
end

it "doesn't show the information about receiving coins" do
visit_steps_page

expect(page).to have_no_content("The usage of the Vocdoni platform has costs")
expect(page).to have_no_content("Test reseller")
expect(page).to have_no_css("input[value='#{wallet.private_key}']")
end
end

context "when prod environment" do
before do
allow(Decidim::Vocdoni).to receive(:api_endpoint_env).and_return("prod")
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_name).and_return("Test reseller")
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_email).and_return("[email protected]")
end
include_context "with environment settings", "prod"

it "shows the information about receiving coins" do
visit_steps_page
Expand All @@ -91,11 +61,7 @@
end

context "when stg environment" do
before do
allow(Decidim::Vocdoni).to receive(:api_endpoint_env).and_return("stg")
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_name).and_return("Test reseller")
allow(Decidim::Vocdoni).to receive(:vocdoni_reseller_email).and_return("[email protected]")
end
include_context "with environment settings", "stg"

it "doesn't show the information about receiving coins" do
visit_steps_page
Expand Down
2 changes: 1 addition & 1 deletion spec/system/decidim/explore_elections_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

it "shows the correct warning" do
visit_component
within ".callout" do
within "[data-announcement]" do
expect(page).to have_content("any election scheduled")
end
end
Expand Down

0 comments on commit 0299817

Please sign in to comment.