From 10eb7f47c8a1b9b2b474258ff81a0c4aa3265ef4 Mon Sep 17 00:00:00 2001 From: Alberto Date: Sat, 16 May 2020 06:07:41 +0200 Subject: [PATCH] Use underscores on HTML IDs --- .../budgets/ballot/_progress_bar.html.erb | 2 +- .../ballot/progress_bar/_knapsack.html.erb | 2 +- spec/system/budgets/ballots_spec.rb | 42 +++++++++---------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/views/budgets/ballot/_progress_bar.html.erb b/app/views/budgets/ballot/_progress_bar.html.erb index 8a41ef59b..516ec7b77 100644 --- a/app/views/budgets/ballot/_progress_bar.html.erb +++ b/app/views/budgets/ballot/_progress_bar.html.erb @@ -9,6 +9,6 @@ -

+

<%= render "budgets/ballot/progress_bar/#{ballot.budget.voting_style}", ballot: ballot, heading: heading %>

diff --git a/app/views/budgets/ballot/progress_bar/_knapsack.html.erb b/app/views/budgets/ballot/progress_bar/_knapsack.html.erb index b46d6d6de..8599a4806 100644 --- a/app/views/budgets/ballot/progress_bar/_knapsack.html.erb +++ b/app/views/budgets/ballot/progress_bar/_knapsack.html.erb @@ -1,5 +1,5 @@ <%= t("budgets.progress_bar.assigned") %><%= ballot.formatted_amount_spent(heading) %> - + <%= t("budgets.progress_bar.available") %> <%= ballot.formatted_amount_available(heading) %> diff --git a/spec/system/budgets/ballots_spec.rb b/spec/system/budgets/ballots_spec.rb index 692b773ab..006ef3ef7 100644 --- a/spec/system/budgets/ballots_spec.rb +++ b/spec/system/budgets/ballots_spec.rb @@ -125,8 +125,8 @@ describe "Ballots" do visit budget_investments_path(budget, heading_id: new_york) add_to_ballot("Bring back King Kong") - expect(page).to have_css("#amount-spent", text: "€10,000") - expect(page).to have_css("#amount-available", text: "€990,000") + expect(page).to have_css("#amount_spent", text: "€10,000") + expect(page).to have_css("#amount_available", text: "€990,000") within("#sidebar") do expect(page).to have_content "Bring back King Kong" @@ -136,8 +136,8 @@ describe "Ballots" do add_to_ballot("Paint cabs black") - expect(page).to have_css("#amount-spent", text: "€30,000") - expect(page).to have_css("#amount-available", text: "€970,000") + expect(page).to have_css("#amount_spent", text: "€30,000") + expect(page).to have_css("#amount_available", text: "€970,000") within("#sidebar") do expect(page).to have_content "Paint cabs black" @@ -152,8 +152,8 @@ describe "Ballots" do visit budget_investments_path(budget, heading_id: new_york) expect(page).to have_content investment.title - expect(page).to have_css("#amount-spent", text: "€10,000") - expect(page).to have_css("#amount-available", text: "€990,000") + expect(page).to have_css("#amount_spent", text: "€10,000") + expect(page).to have_css("#amount_available", text: "€990,000") within("#sidebar") do expect(page).to have_content investment.title @@ -165,8 +165,8 @@ describe "Ballots" do find(".remove a").click end - expect(page).to have_css("#amount-spent", text: "€0") - expect(page).to have_css("#amount-available", text: "€1,000,000") + expect(page).to have_css("#amount_spent", text: "€0") + expect(page).to have_css("#amount_available", text: "€1,000,000") within("#sidebar") do expect(page).not_to have_content investment.title @@ -217,8 +217,8 @@ describe "Ballots" do add_to_ballot("Cheap") - expect(page).to have_css("#amount-spent", text: "€10,000") - expect(page).to have_css("#amount-available", text: "€9,990,000") + expect(page).to have_css("#amount_spent", text: "€10,000") + expect(page).to have_css("#amount_available", text: "€9,990,000") within("#sidebar") do expect(page).to have_content "Cheap" @@ -227,13 +227,13 @@ describe "Ballots" do visit budget_investments_path(budget, heading_id: district_heading1) - expect(page).to have_css("#amount-spent", text: "€0") - expect(page).to have_css("#amount-spent", text: "€1,000,000") + expect(page).to have_css("#amount_spent", text: "€0") + expect(page).to have_css("#amount_available", text: "€1,000,000") add_to_ballot("Average") - expect(page).to have_css("#amount-spent", text: "€20,000") - expect(page).to have_css("#amount-available", text: "€980,000") + expect(page).to have_css("#amount_spent", text: "€20,000") + expect(page).to have_css("#amount_available", text: "€980,000") within("#sidebar") do expect(page).to have_content "Average" @@ -245,8 +245,8 @@ describe "Ballots" do visit budget_investments_path(budget, heading_id: city_heading) - expect(page).to have_css("#amount-spent", text: "€10,000") - expect(page).to have_css("#amount-available", text: "€9,990,000") + expect(page).to have_css("#amount_spent", text: "€10,000") + expect(page).to have_css("#amount_available", text: "€9,990,000") within("#sidebar") do expect(page).to have_content "Cheap" @@ -270,7 +270,7 @@ describe "Ballots" do add_to_ballot("Park expansion") within("#progress_bar") do - expect(page).to have_css("#amount-spent", text: "€10,000") + expect(page).to have_css("#amount_spent", text: "€10,000") end end end @@ -395,8 +395,8 @@ describe "Ballots" do login_as(user) visit budget_investments_path(budget, heading_id: new_york.id) - expect(page).to have_css("#amount-spent", text: "€30,000") - expect(page).to have_css("#amount-available", text: "€970,000") + expect(page).to have_css("#amount_spent", text: "€30,000") + expect(page).to have_css("#amount_available", text: "€970,000") within("#sidebar") do expect(page).to have_content investment1.title @@ -410,8 +410,8 @@ describe "Ballots" do click_link "Remove vote" end - expect(page).to have_css("#amount-spent", text: "€20,000") - expect(page).to have_css("#amount-available", text: "€980,000") + expect(page).to have_css("#amount_spent", text: "€20,000") + expect(page).to have_css("#amount_available", text: "€980,000") within("#sidebar") do expect(page).not_to have_content investment1.title