Make content assertion order-independent
This commit is contained in:
@@ -142,7 +142,10 @@ feature 'Votes' do
|
||||
within("#budget_investment_#{third_heading_investment.id}") do
|
||||
find('.in-favor a').click
|
||||
|
||||
expect(page).to have_content "You can only support investment projects in 2 districts. You have already supported investments in #{new_york.name} and #{san_francisco.name}"
|
||||
expect(page).to have_content "You can only support investment projects in 2 districts. You have already supported investments in"
|
||||
|
||||
heading_names = find('.participation-not-allowed').text.match(/You have already supported investments in (.+) and (.+)\./)&.captures
|
||||
expect(heading_names).to match_array [new_york.name, san_francisco.name]
|
||||
|
||||
expect(page).not_to have_content "1 support"
|
||||
expect(page).not_to have_content "You have already supported this investment project. Share it!"
|
||||
@@ -165,7 +168,10 @@ feature 'Votes' do
|
||||
visit budget_investment_path(budget, third_heading_investment)
|
||||
|
||||
find('.in-favor a').click
|
||||
expect(page).to have_content "You can only support investment projects in 2 districts. You have already supported investments in #{new_york.name} and #{san_francisco.name}"
|
||||
expect(page).to have_content "You can only support investment projects in 2 districts. You have already supported investments in"
|
||||
|
||||
heading_names = find('.participation-not-allowed').text.match(/You have already supported investments in (.+) and (.+)\./)&.captures
|
||||
expect(heading_names).to match_array [new_york.name, san_francisco.name]
|
||||
|
||||
expect(page).not_to have_content "1 support"
|
||||
expect(page).not_to have_content "You have already supported this investment project. Share it!"
|
||||
|
||||
Reference in New Issue
Block a user