percy-capybara 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4fa53f0081ebabd12000ff5f39c06e28297bfbc
4
- data.tar.gz: 21b44860cfa4b8889f19a4f58d2584885c25f67b
3
+ metadata.gz: 12bada606db24ecb479120df317bad285e7b8bb9
4
+ data.tar.gz: 078e75d9078652686011fc68c1002487b0b534d7
5
5
  SHA512:
6
- metadata.gz: fdfa8ff47bc03eb7305d70c67be28340b6de54fa84c60705f67d4f60349c303c0588832f8730b0a8c8c923a0c37abadee5ce6cffa0f8d3e832e4b68fc386c6a7
7
- data.tar.gz: 72a3006999f0a1af062faf9eba13cabc40ea8d888373cb7bb3b1b9a682173be2f76780598e18e6ded726eebb728e0a984ed491b33c20aca0883e834b00d58844
6
+ metadata.gz: c5832b7d3adac95504cadef29bf2518941ec16746510983055abd1779086379384cbbfb4a41aa2cf9bf56fc470d9191f5e446de801bda37bbc974034fa3ed6a8
7
+ data.tar.gz: 729aa019732cc735111a3b48ace21e2087b39d1737c64fc5b7a0c81392583e5502ce481a2d4efabbab433c35c1586033122a46b6158a97ad9172631bb333716f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- percy-capybara (2.3.0)
4
+ percy-capybara (2.3.1)
5
5
  percy-client (~> 1.4)
6
6
 
7
7
  GEM
@@ -44,7 +44,7 @@ GEM
44
44
  guard-compat (~> 1.1)
45
45
  rspec (>= 2.99.0, < 4.0)
46
46
  hashdiff (0.2.3)
47
- httpclient (2.8.1)
47
+ httpclient (2.8.2.2)
48
48
  json (1.8.3)
49
49
  listen (3.0.6)
50
50
  rb-fsevent (>= 0.9.3)
@@ -37,6 +37,10 @@ module Percy
37
37
  next if SKIP_RESOURCE_EXTENSIONS.include?(File.extname(logical_path))
38
38
 
39
39
  asset = sprockets_environment.find_asset(logical_path)
40
+
41
+ # Skip large files, these are hopefully downloads and not used in page rendering.
42
+ next if asset.length > MAX_FILESIZE_BYTES
43
+
40
44
  content = asset.to_s
41
45
  sha = Digest::SHA256.hexdigest(content)
42
46
 
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Capybara
3
- VERSION = '2.3.0'
3
+ VERSION = '2.3.1'
4
4
  end
5
5
  end
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 170 110" enable-background="new 0 0 170 110" xml:space="preserve">
5
+ <g>
6
+ <g>
7
+ <polyline fill="#1F0924" points="49.2,97.6 9.4,103.4 46,86.8 6.2,81.2 46,75.6 9.4,59 49.2,64.9 18.7,38.6 55.2,55.4 33.4,21.7
8
+ 63.7,48.1 52.2,9.6 73.9,43.4 73.7,3.2 85,41.8 96.2,3.2 96.1,43.4 117.7,9.5 106.3,48.1 136.5,21.6 114.7,55.4 151.2,38.6
9
+ 120.8,64.8 160.6,59 124,75.6 163.8,81.1 124,86.8 160.6,103.3 120.8,97.5 "/>
10
+ <polyline fill="#EDDDC2" points="52.8,90.2 18.5,90.3 51.4,80.7 18.5,71.2 52.8,71.3 23.9,52.8 56.8,62.6 63,55.4 48.7,24.2
11
+ 71.1,50.2 66.1,16.3 80.2,47.5 85,13.5 89.8,47.5 103.9,16.3 98.9,50.2 121.3,24.2 107,55.4 113.2,62.6 146.1,52.8 117.2,71.3
12
+ 151.5,71.2 118.6,80.7 151.5,90.3 117.2,90.2 "/>
13
+ </g>
14
+ <polygon fill="#EDDDC2" points="108.3,45.7 134.4,39.1 127.9,65.2 "/>
15
+ <polygon fill="#1F0924" points="114.2,48.6 128.5,45 124.9,59.3 114.2,59.3 "/>
16
+ <polygon fill="#EDDDC2" points="61.7,45.7 35.6,39.1 42.1,65.2 "/>
17
+ <polygon fill="#1F0924" points="55.8,48.6 41.5,45 45.1,59.3 55.8,59.3 "/>
18
+ <polyline fill="#B157B5" points="38.3,101.1 131.7,101.1 166.8,88.5 131.5,76 155.8,47.6 119,54.5 125.9,17.7 97.5,42 85,6.7
19
+ 72.5,42 44.1,17.7 51,54.5 14.2,47.6 38.5,76 3.2,88.5 "/>
20
+ <circle fill="#EDDDC2" cx="61.4" cy="78.7" r="12.1"/>
21
+ <circle fill="#1F0924" cx="61.4" cy="78.7" r="9.5"/>
22
+ <circle fill="#EDDDC2" cx="58.2" cy="75.5" r="4.2"/>
23
+ <circle fill="#EDDDC2" cx="108.6" cy="78.7" r="12.1"/>
24
+ <circle fill="#1F0924" cx="108.6" cy="78.7" r="9.5"/>
25
+ <circle fill="#EDDDC2" cx="105.3" cy="75.5" r="4.2"/>
26
+ <path fill="#EDDDC2" d="M62.9,97.6c0-12.2,9.9-22.1,22.1-22.1s22.1,9.9,22.1,22.1S62.9,109.8,62.9,97.6z"/>
27
+ <path fill="#1F0924" d="M89.8,96.5c-2,0-3.7-1-4.8-2.5c-1,1.5-2.8,2.5-4.8,2.5c-3.2,0-5.8-2.6-5.8-5.8c0-0.6,0.4-1,1-1s1,0.4,1,1
28
+ c0,2.1,1.7,3.8,3.8,3.8s3.8-1.7,3.8-3.8h2c0,2.1,1.7,3.8,3.8,3.8s3.8-1.7,3.8-3.8c0-0.6,0.4-1,1-1s1,0.4,1,1
29
+ C95.5,93.9,93,96.5,89.8,96.5z"/>
30
+ <path fill="#1F0924" d="M92.8,83.6c0,4.3-3.5,7.8-7.8,7.8s-7.8-3.5-7.8-7.8C77.2,79.3,92.8,79.3,92.8,83.6z"/>
31
+ <path fill="#EDDDC2" d="M47,101.3c0-4,3.2-7.3,7.3-7.3s7.3,3.2,7.3,7.3S47,105.3,47,101.3z"/>
32
+ <path fill="#EDDDC2" d="M108.4,101.3c0-4,3.2-7.3,7.3-7.3c4,0,7.3,3.2,7.3,7.3S108.4,105.3,108.4,101.3z"/>
33
+ </g>
34
+ </svg>
@@ -23,8 +23,8 @@ RSpec.describe Percy::Capybara::Loaders::SprocketsLoader do
23
23
  let(:digest_enabled) { false }
24
24
  let(:sprockets_options) do
25
25
  options = double('options')
26
- # Set specific files we want to compile. In normal use, this would be all CSS and JS files.
27
- precompile_list = [/(?:\/|\\|\A)(base|digested)\.(css|js)$|\.map/]
26
+ # Set specific files we want to compile. In normal use, this would be all asset files.
27
+ precompile_list = [/(?:\/|\\|\A)(base|digested)\.(css|js)$|\.map|\.png/]
28
28
  allow(options).to receive(:precompile).and_return(precompile_list)
29
29
  allow(options).to receive(:digest).and_return(digest_enabled)
30
30
  options
@@ -58,6 +58,15 @@ RSpec.describe Percy::Capybara::Loaders::SprocketsLoader do
58
58
  expected_resources = [
59
59
  '/assets/css/base.css',
60
60
  '/assets/css/digested.css',
61
+ '/assets/images/bg-relative-to-root.png',
62
+ '/assets/images/bg-relative.png',
63
+ '/assets/images/bg-stacked.png',
64
+ '/assets/images/img-relative-to-root.png',
65
+ '/assets/images/img-relative.png',
66
+ # '/assets/images/large-file-skipped.png', # Note: intentionally missing.
67
+ '/assets/images/srcset-base.png',
68
+ '/assets/images/srcset-first.png',
69
+ '/assets/images/srcset-second.png',
61
70
  '/assets/js/base.js',
62
71
  ]
63
72
  expect(resources.map { |r| r.resource_url }).to eq(expected_resources)
@@ -68,13 +77,18 @@ RSpec.describe Percy::Capybara::Loaders::SprocketsLoader do
68
77
  # Pretend like we're in a Rails app right now, all we care about is Rails.public_path.
69
78
  rails_double = double('Rails')
70
79
  # Pretend like the entire testdata directory is the public/ folder.
71
- expect(rails_double).to receive(:public_path).and_return(environment.root)
80
+ expect(rails_double).to receive(:public_path).and_return(environment.root + '/public')
72
81
  expect(loader).to receive(:_rails).at_least(:once).and_return(rails_double)
73
82
  end
74
83
  it 'includes files from the public folder (non-asset-pipeline)' do
75
84
  resources = loader.build_resources
76
- expect(resources.length).to be > 5 # Weak test that more things are in this list.
77
- expect(resources.map { |r| r.resource_url }).to include('/images/percy.svg')
85
+ # Weak test that more things are in this list, because it merges asset pipeline with public.
86
+ expect(resources.length).to be > 5
87
+
88
+ resource_urls = resources.map { |r| r.resource_url }
89
+ expect(resource_urls).to include('/assets/images/bg-relative.png') # From asset pipeline.
90
+ expect(resource_urls).to include('/percy-from-public.svg') # Public merged into root.
91
+ expect(resource_urls).to_not include('/large-file-skipped.png') # Public merged into root.
78
92
  end
79
93
  context 'digest enabled' do
80
94
  let(:digest_enabled) { true }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy-capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-11 00:00:00.000000000 Z
11
+ date: 2016-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: percy-client
@@ -195,6 +195,7 @@ files:
195
195
  - spec/lib/percy/capybara/client/builds_spec.rb
196
196
  - spec/lib/percy/capybara/client/snapshots_spec.rb
197
197
  - spec/lib/percy/capybara/client/testdata/assets/css/digested-f3420c6aee71c137a3ca39727052811bae84b2f37d898f4db242e20656a1579e.css
198
+ - spec/lib/percy/capybara/client/testdata/assets/images/large-file-skipped.png
198
199
  - spec/lib/percy/capybara/client/testdata/css/base.css
199
200
  - spec/lib/percy/capybara/client/testdata/css/digested.css
200
201
  - spec/lib/percy/capybara/client/testdata/css/imports.css
@@ -215,6 +216,8 @@ files:
215
216
  - spec/lib/percy/capybara/client/testdata/images/srcset-second.png
216
217
  - spec/lib/percy/capybara/client/testdata/index.html
217
218
  - spec/lib/percy/capybara/client/testdata/js/base.js
219
+ - spec/lib/percy/capybara/client/testdata/public/large-file-skipped.png
220
+ - spec/lib/percy/capybara/client/testdata/public/percy-from-public.svg
218
221
  - spec/lib/percy/capybara/client/testdata/test-css.html
219
222
  - spec/lib/percy/capybara/client/testdata/test-iframe.html
220
223
  - spec/lib/percy/capybara/client/testdata/test-images.html
@@ -246,7 +249,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
249
  version: '0'
247
250
  requirements: []
248
251
  rubyforge_project:
249
- rubygems_version: 2.4.8
252
+ rubygems_version: 2.4.5.1
250
253
  signing_key:
251
254
  specification_version: 4
252
255
  summary: Percy::Capybara
@@ -254,6 +257,7 @@ test_files:
254
257
  - spec/lib/percy/capybara/client/builds_spec.rb
255
258
  - spec/lib/percy/capybara/client/snapshots_spec.rb
256
259
  - spec/lib/percy/capybara/client/testdata/assets/css/digested-f3420c6aee71c137a3ca39727052811bae84b2f37d898f4db242e20656a1579e.css
260
+ - spec/lib/percy/capybara/client/testdata/assets/images/large-file-skipped.png
257
261
  - spec/lib/percy/capybara/client/testdata/css/base.css
258
262
  - spec/lib/percy/capybara/client/testdata/css/digested.css
259
263
  - spec/lib/percy/capybara/client/testdata/css/imports.css
@@ -274,6 +278,8 @@ test_files:
274
278
  - spec/lib/percy/capybara/client/testdata/images/srcset-second.png
275
279
  - spec/lib/percy/capybara/client/testdata/index.html
276
280
  - spec/lib/percy/capybara/client/testdata/js/base.js
281
+ - spec/lib/percy/capybara/client/testdata/public/large-file-skipped.png
282
+ - spec/lib/percy/capybara/client/testdata/public/percy-from-public.svg
277
283
  - spec/lib/percy/capybara/client/testdata/test-css.html
278
284
  - spec/lib/percy/capybara/client/testdata/test-iframe.html
279
285
  - spec/lib/percy/capybara/client/testdata/test-images.html