Skip to content

Commit

Permalink
Don't define methods on object
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Sep 8, 2022
1 parent 29a3593 commit a5f15d2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/solidus_dev_support/rspec/feature_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
require 'solidus_dev_support/rspec/rails_helper'
require 'solidus_dev_support/rspec/capybara'

def dev_support_assets_preload
dev_support_assets_preload = ->(*) {
if Rails.application.respond_to?(:precompiled_assets)
Rails.application.precompiled_assets
else
Expand All @@ -19,18 +19,14 @@ def dev_support_assets_preload
Rails.application.assets.find_asset(asset)
end
end
end
}

RSpec.configure do |config|
config.when_first_matching_example_defined(type: :feature) do
config.before :suite do
dev_support_assets_preload
end
config.before :suite, &dev_support_assets_preload
end

config.when_first_matching_example_defined(type: :system) do
config.before :suite do
dev_support_assets_preload
end
config.before :suite, &dev_support_assets_preload
end
end

0 comments on commit a5f15d2

Please sign in to comment.