Improve styles for budgets voting phase

This commit is contained in:
Alberto
2020-05-16 06:07:41 +02:00
committed by Javi Martín
parent f79edf6ba4
commit 048ca61207
21 changed files with 212 additions and 142 deletions

View File

@@ -125,7 +125,7 @@ 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("#total_amount", text: "€10,000")
expect(page).to have_css("#amount_available", text: "€990,000")
within("#sidebar") do
@@ -136,7 +136,7 @@ describe "Ballots" do
add_to_ballot("Paint cabs black")
expect(page).to have_css("#amount_spent", text: "€30,000")
expect(page).to have_css("#total_amount", text: "€30,000")
expect(page).to have_css("#amount_available", text: "€970,000")
within("#sidebar") do
@@ -152,7 +152,7 @@ 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("#total_amount", text: "€10,000")
expect(page).to have_css("#amount_available", text: "€990,000")
within("#sidebar") do
@@ -165,7 +165,7 @@ describe "Ballots" do
find(".remove a").click
end
expect(page).to have_css("#amount_spent", text: "€0")
expect(page).to have_css("#total_amount", text: "€0")
expect(page).to have_css("#amount_available", text: "€1,000,000")
within("#sidebar") do
@@ -217,7 +217,7 @@ describe "Ballots" do
add_to_ballot("Cheap")
expect(page).to have_css("#amount_spent", text: "€10,000")
expect(page).to have_css("#total_amount", text: "€10,000")
expect(page).to have_css("#amount_available", text: "€9,990,000")
within("#sidebar") do
@@ -227,12 +227,12 @@ 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("#total_amount", 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("#total_amount", text: "€20,000")
expect(page).to have_css("#amount_available", text: "€980,000")
within("#sidebar") do
@@ -245,7 +245,7 @@ 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("#total_amount", text: "€10,000")
expect(page).to have_css("#amount_available", text: "€9,990,000")
within("#sidebar") do
@@ -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("#total_amount", text: "€10,000")
end
end
end
@@ -323,7 +323,7 @@ describe "Ballots" do
end
end
context "Showing the ballot" do
context "Showing the ballot", :js do
scenario "Displaying the correct group, heading, count & amount" do
group1 = create(:budget_group, budget: budget)
group2 = create(:budget_group, budget: budget)
@@ -350,13 +350,13 @@ describe "Ballots" do
within("#budget_group_#{group1.id}") do
expect(page).to have_content "#{group1.name} - #{heading1.name}"
expect(page).to have_content "Amount spent €20"
expect(page).to have_link "You still have €80 to invest.", href: budget_group_path(budget, group1)
expect(page).to have_link "Still available to you €80", href: budget_group_path(budget, group1)
end
within("#budget_group_#{group2.id}") do
expect(page).to have_content "#{group2.name} - #{heading2.name}"
expect(page).to have_content "Amount spent €15"
expect(page).to have_content "You still have €35 to invest"
expect(page).to have_content "Still available to you €35"
end
end
@@ -395,7 +395,7 @@ 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("#total_amount", text: "€30,000")
expect(page).to have_css("#amount_available", text: "€970,000")
within("#sidebar") do
@@ -410,7 +410,7 @@ describe "Ballots" do
click_link "Remove vote"
end
expect(page).to have_css("#amount_spent", text: "€20,000")
expect(page).to have_css("#total_amount", text: "€20,000")
expect(page).to have_css("#amount_available", text: "€980,000")
within("#sidebar") do

View File

@@ -211,7 +211,7 @@ describe "Votes" do
add_to_ballot(investment1.title)
expect(page).to have_content("Remove vote")
expect(page).to have_content("You have selected 1 project out of 2")
expect(page).to have_content("YOU CAN STILL CAST 1 VOTE")
within(".budget-investment", text: investment2.title) do
find("div.ballot").hover