do not display alert when supporting for whole city

This commit is contained in:
rgarcia
2017-03-10 21:57:24 +01:00
committed by decabeza
parent 9da2783814
commit 55fb14ac14
3 changed files with 30 additions and 8 deletions

View File

@@ -1307,6 +1307,7 @@ feature 'Budget Investments' do
carabanchel_investment = create(:budget_investment, :selected, heading: carabanchel)
salamanca_investment = create(:budget_investment, :selected, heading: salamanca)
login_as(author)
visit budget_investments_path(budget, heading_id: carabanchel.id)
within("#budget_investment_#{carabanchel_investment.id}") do
@@ -1332,21 +1333,35 @@ feature 'Budget Investments' do
end
scenario "When supporting in another group", :js do
carabanchel = create(:budget_heading, group: group)
another_heading = create(:budget_heading, group: create(:budget_group, budget: budget))
heading = create(:budget_heading, group: group)
carabanchel_investment = create(:budget_investment, heading: carabanchel)
another_group_investment = create(:budget_investment, heading: another_heading)
group2 = create(:budget_group, budget: budget)
another_heading1 = create(:budget_heading, group: group2)
another_heading2 = create(:budget_heading, group: group2)
create(:vote, votable: carabanchel_investment, voter: author)
heading_investment = create(:budget_investment, heading: heading)
another_group_investment = create(:budget_investment, heading: another_heading1)
create(:vote, votable: heading_investment, voter: author)
login_as(author)
visit budget_investments_path(budget, heading_id: another_heading.id)
visit budget_investments_path(budget, heading_id: another_heading1.id)
within("#budget_investment_#{another_group_investment.id}") do
expect(page).to have_css(".in-favor a[data-confirm]")
end
end
scenario "When supporting in a group with a single heading", :js do
all_city_investment = create(:budget_investment, heading: heading)
login_as(author)
visit budget_investments_path(budget, heading_id: heading.id)
within("#budget_investment_#{all_city_investment.id}") do
expect(page).not_to have_css(".in-favor a[data-confirm]")
end
end
end
scenario "Sidebar in show should display support text" do