Make spec less flaky by making it wait for the Saving text to go away

This commit is contained in:
Luis Ramos
2020-06-02 20:19:29 +01:00
parent 72870530ce
commit cf5af68438

View File

@@ -199,6 +199,9 @@ feature "
expect do
click_button 'Save Changes'
# We need to wait_until because the save action is not fast enough for the have_content matcher
wait_until { page.find("#status-message").text != "Saving..." }
expect(page).to have_content "I couldn't get authorisation to save those changes, so they remain unsaved."
end.to change(VariantOverride, :count).by(0)
end