Fix test checking same group investment support

We meant to check that the link to support a different investment didn't
have an alert dialog. However, we were testing by trying to support the
same investment twice, and here there was no link at all, so the
assertion "there's no link with a dialog" always passed even when the
application didn't behave properly.

Now we check there's a link there, and that link doesn't have an
associated alert dialog.
This commit is contained in:
Javi Martín
2021-06-12 19:20:33 +02:00
parent de436e33a4
commit 0b287e4a78

View File

@@ -1122,12 +1122,14 @@ describe "Budget Investments" do
salamanca = create(:budget_heading, group: group) salamanca = create(:budget_heading, group: group)
create(:budget_investment, title: "In Carabanchel", heading: carabanchel, voters: [author]) create(:budget_investment, title: "In Carabanchel", heading: carabanchel, voters: [author])
create(:budget_investment, title: "Unsupported in Carabanchel", heading: carabanchel)
create(:budget_investment, title: "In Salamanca", heading: salamanca) create(:budget_investment, title: "In Salamanca", heading: salamanca)
login_as(author) login_as(author)
visit budget_investments_path(budget, heading_id: carabanchel.id) visit budget_investments_path(budget, heading_id: carabanchel.id)
within(".budget-investment", text: "In Carabanchel") do within(".budget-investment", text: "Unsupported in Carabanchel") do
expect(page).to have_link "Support"
expect(page).not_to have_css(".in-favor a[data-confirm]") expect(page).not_to have_css(".in-favor a[data-confirm]")
end end
end end