Restructure flaky customer spec

This commit is contained in:
Rob Harrington
2017-11-02 16:24:03 +11:00
committed by Rob H
parent 694f1e9b25
commit 5febd0a0d6

View File

@@ -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