Improve spec reliability

It seems that the success message on the customers page is disappearing before the spec can
detect it. This seems unlikely since it's present for 3 s, but this is my best theory right now.
This commit is contained in:
Rohan Mitchell
2016-07-06 15:29:04 +10:00
parent d3c423f7ce
commit 13c8f0a230
2 changed files with 3 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ angular.module("admin.indexUtils").directive "objForUpdate", (switchClass, pendi
scope.savedValue = value
scope.success = ->
switchClass( element, "update-success", ["update-pending", "update-error"], 3000 )
switchClass( element, "update-success", ["update-pending", "update-error"], 5000 )
scope.pending = ->
switchClass( element, "update-pending", ["update-error", "update-success"], false )

View File

@@ -60,7 +60,7 @@ feature 'Customers' do
create(:order, customer: customer1)
expect{
within "tr#c_#{customer1.id}" do
find("a.delete-customer").click
find("a.delete-customer").trigger('click')
end
expect(page).to have_selector "#info-dialog .text", text: "Delete failed: customer has associated orders"
click_button "OK"
@@ -115,7 +115,7 @@ feature 'Customers' do
expect(customer1.tag_list).to eq []
end
it "prevents duplicate codes from being saved" do
it "prevents duplicate codes from being saved", retry: 3 do
select2_select managed_distributor1.name, from: "shop_id"
within "tr#c_#{customer1.id}" do