spec/lib/percy/capybara/loaders/sprockets_loader_spec.rb in percy-capybara-2.5.0 vs spec/lib/percy/capybara/loaders/sprockets_loader_spec.rb in percy-capybara-2.5.1
- old
+ new
@@ -22,11 +22,11 @@
end
let(:digest_enabled) { false }
let(:sprockets_options) do
options = double('options')
# Set specific files we want to compile. In normal use, this would be all asset files.
- precompile_list = [/(?:\/|\\|\A)(base|digested)\.(css|js)$|\.map|\.png/]
+ precompile_list = [%r{(?:/|\\|\A)(base|digested)\.(css|js)$|\.map|\.png}]
allow(options).to receive(:precompile).and_return(precompile_list)
allow(options).to receive(:digest).and_return(digest_enabled)
options
end
@@ -75,9 +75,10 @@
context 'Rails app' do
before do
# Pretend like we're in a Rails app right now, all we care about is Rails.public_path.
rails_double = double('Rails')
# Pretend like the entire testdata directory is the public/ folder.
+ expect(rails_double).to receive(:application).and_return(nil)
expect(rails_double).to receive(:public_path).and_return(environment.root + '/public')
expect(loader).to receive(:_rails).at_least(:once).and_return(rails_double)
end
it 'includes files from the public folder (non-asset-pipeline)' do
resources = loader.build_resources