spec/lib/percy/capybara/loaders/native_loader_spec.rb in percy-capybara-2.4.3 vs spec/lib/percy/capybara/loaders/native_loader_spec.rb in percy-capybara-2.4.4
- old
+ new
@@ -28,10 +28,22 @@
'/css/level2-imports.css',
'/css/simple-imports.css',
],
)
end
+ it 'returns the font resources' do
+ visit '/test-font.html'
+ loader = described_class.new(page: page)
+ resource_urls = loader.snapshot_resources.collect(&:resource_url)
+ expect(resource_urls).to match_array(
+ [
+ '/test-font.html',
+ '/css/font.css',
+ '/assets/bootstrap/glyphicons-halflings-regular-13634da.eot',
+ ],
+ )
+ end
it 'returns the root HTML and image resources' do
visit '/test-images.html'
loader = described_class.new(page: page)
resource_urls = loader.snapshot_resources.collect(&:resource_url)
expect(resource_urls).to match_array(
@@ -182,9 +194,10 @@
describe '#_get_image_resources', type: :feature, js: true do
it 'includes all images' do
visit '/test-images.html'
loader = described_class.new(page: page)
+ loader.instance_variable_set(:@urls_referred_by_css, [])
resources = loader.send(:_get_image_resources)
# The order of these is just for convenience, they match the order in test-images.html.
resource = find_resource(resources, '/images/img-relative.png')