From cf5af684388d4bff182c89022f078a358c10b264 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Tue, 2 Jun 2020 20:19:29 +0100 Subject: [PATCH] Make spec less flaky by making it wait for the Saving text to go away --- spec/features/admin/variant_overrides_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/features/admin/variant_overrides_spec.rb b/spec/features/admin/variant_overrides_spec.rb index 1869133774..4c2312c7ee 100644 --- a/spec/features/admin/variant_overrides_spec.rb +++ b/spec/features/admin/variant_overrides_spec.rb @@ -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