Add expectations to check requests are complete
We want to make sure the request is finished after clicking a button and before visiting a different page, so we need to check the page has changed. Usually this shouldn't be a problem because most of our forms are sent with regular HTTP requests instead of AJAX ones, so the `visit` method wouldn't be called before the request is finished. However, we're experiencing problems with certain version of Chromedriver, and in general it's a good practice because we might send forms using AJAX/Turbolinks in the future.
This commit is contained in:
@@ -301,6 +301,8 @@ describe "System Emails" do
|
||||
click_on "Moderate notification send"
|
||||
end
|
||||
|
||||
expect(page).not_to have_content("Proposal A Title")
|
||||
|
||||
visit admin_system_email_preview_pending_path("proposal_notification_digest")
|
||||
|
||||
expect(page).to have_content("Proposal B")
|
||||
|
||||
Reference in New Issue
Block a user