add more diagnostics for flaky spec

This commit is contained in:
Sam
2017-08-23 10:41:47 -04:00
parent 1d90f6016a
commit c7532003f3
2 changed files with 26 additions and 2 deletions

View File

@ -61,7 +61,7 @@ module Helpers
Guardian.stubs(new: guardian).with(user)
end
def wait_for(&blk)
def wait_for(on_fail: nil, &blk)
i = 0
result = false
while !result && i < 1000
@ -70,6 +70,7 @@ module Helpers
sleep 0.001
end
on_fail&.call
expect(result).to eq(true)
end