diff --git a/config/environments/test.rb b/config/environments/test.rb index 68c74dab..7f2ca59e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -11,6 +11,13 @@ Osem::Application.configure do config.serve_static_files = true config.static_cache_control = 'public, max-age=3600' + # Use memory store for assets cache intest to avoid caching to tmp/assets, + # because it causes hiding of deprecation messages in stylesheets, and + # reduces performance. + config.assets.configure do |env| + env.cache = ActiveSupport::Cache.lookup_store(:memory_store) + end + # Do not eager load code on boot. config.eager_load = false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d9283117..92420826 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -59,7 +59,13 @@ RSpec.configure do |config| Capybara.javascript_driver = :poltergeist Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path, js_errors: false, window_size: [1920, 1080]) + Capybara::Poltergeist::Driver.new( + app, + phantomjs: Phantomjs.path, + js_errors: false, + window_size: [1920, 1080], + url_whitelist: ['http://www.example.com'] + ) end # Includes helpers and connect them to specific types of tests