From 5febd0a0d67348178e6572bb8ba6cc97e1f1f3b3 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Thu, 2 Nov 2017 16:24:03 +1100 Subject: [PATCH] Restructure flaky customer spec --- spec/features/admin/customers_spec.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spec/features/admin/customers_spec.rb b/spec/features/admin/customers_spec.rb index 1ab377ca3f..c91f5cf835 100644 --- a/spec/features/admin/customers_spec.rb +++ b/spec/features/admin/customers_spec.rb @@ -132,16 +132,20 @@ feature 'Customers' do fill_in "code", with: "new-customer-code" expect(page).to have_css "input[name=code].update-pending" end - within "tr#c_#{customer2.id}" do - fill_in "code", with: "new-customer-code" - expect(page).to have_content "This code is used already." - end + click_button "Save Changes" within "tr#c_#{customer1.id}" do expect(page).to have_css "input[name=code].update-success" end + within "tr#c_#{customer2.id}" do + fill_in "code", with: "new-customer-code" + expect(page).to have_content "This code is used already." + end + + click_button "Save Changes" + within "tr#c_#{customer2.id}" do expect(page).to have_css "input[name=code].update-error" end