Skip to content

Commit

Permalink
Assets precompile integration tests: try several times before to read…
Browse files Browse the repository at this point in the history
… the manifest file
  • Loading branch information
jodosha committed Oct 19, 2016
1 parent 4f47a37 commit 068f1a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion spec/integration/cli/assets/precompile_spec.rb
Expand Up @@ -50,7 +50,10 @@ class Dashboard
#
# Verify manifest
#
manifest = File.read("public/assets.json")
manifest = retry_exec(Errno::ENOENT) do
File.read("public/assets.json")
end

expect(JSON.parse(manifest)).to be_kind_of(Hash) # assert it's a well-formed JSON

expect(manifest).to include(%("/assets/admin/dashboard.js":{"target":"/assets/admin/dashboard-39744f9626a70683b6c2d46305798883.js","sri":["sha256-1myPVWoqrq+uAVP2DSkmAown+5dm0x61+E3AjlGOKEc="]}))
Expand Down
2 changes: 1 addition & 1 deletion spec/support/retry.rb
Expand Up @@ -10,7 +10,7 @@ def retry_exec(exception, &blk)
sleep 1
blk.call # rubocop:disable Performance/RedundantBlockCall
rescue exception
raise if attempts > 3
raise if attempts > 10
attempts += 1
retry
end
Expand Down

0 comments on commit 068f1a7

Please sign in to comment.