Use JavaScript in tests opening modal dialogs

This way we reproduce the user experience in the tests, and we can make
sure modal dialogs open when we expect it.
This commit is contained in:
Javi Martín
2021-03-29 13:28:41 +02:00
parent fbc78984dc
commit b2bc4d19f5
38 changed files with 221 additions and 178 deletions

View File

@@ -997,7 +997,7 @@ describe "Budget Investments" do
end
end
scenario "Author can destroy while on the accepting phase" do
scenario "Author can destroy while on the accepting phase", :js do
user = create(:user, :level_two)
investment1 = create(:budget_investment, heading: heading, price: 10000, author: user)
@@ -1006,7 +1006,8 @@ describe "Budget Investments" do
within("#budget_investment_#{investment1.id}") do
expect(page).to have_content(investment1.title)
click_link("Delete")
accept_confirm { click_link("Delete") }
end
visit user_path(user, tab: :budget_investments)