Skip to content

Commit

Permalink
Merge pull request #2117 from jhawthorn/preload_assets_in_backend_specs
Browse files Browse the repository at this point in the history
Preload assets before backend specs
  • Loading branch information
jhawthorn authored Jul 26, 2017
2 parents 5283b4c + 8d2dce6 commit e791835
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backend/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@
DatabaseCleaner.clean_with :truncation
end

config.when_first_matching_example_defined(type: :feature) do
config.before :suite do
# Preload assets
# This should avoid capybara timeouts, and avoid counting asset compilation
# towards the timing of the first feature spec.
Rails.application.precompiled_assets
end
end

config.prepend_before(:each) do
if RSpec.current_example.metadata[:js]
DatabaseCleaner.strategy = :truncation
Expand Down

0 comments on commit e791835

Please sign in to comment.