Use underscores on HTML IDs

This commit is contained in:
Alberto
2020-05-16 06:07:41 +02:00
committed by Javi Martín
parent 896fee6e99
commit 10eb7f47c8
3 changed files with 23 additions and 23 deletions

View File

@@ -9,6 +9,6 @@
</div>
</div>
<p id="amount-spent" class="spent-amount-text" style="width: <%= ballot.percentage_spent(heading) %>%">
<p id="amount_spent" class="spent-amount-text" style="width: <%= ballot.percentage_spent(heading) %>%">
<%= render "budgets/ballot/progress_bar/#{ballot.budget.voting_style}", ballot: ballot, heading: heading %>
</p>

View File

@@ -1,5 +1,5 @@
<small><%= t("budgets.progress_bar.assigned") %></small><%= ballot.formatted_amount_spent(heading) %>
<span id="amount-available" class="amount-available">
<span id="amount_available" class="amount-available">
<small><%= t("budgets.progress_bar.available") %></small>
<span><%= ballot.formatted_amount_available(heading) %></span>
</span>

View File

@@ -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