percy-capybara 3.1.2 → 3.2.0

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: 58f05b4af92c2331c4f96ea61734cb56240a847f
4
- data.tar.gz: ecb08a90a16eb404f2815c849162ff467935560e
3
+ metadata.gz: d765232c28dd6dd5daabd909841b5635422ee4c3
4
+ data.tar.gz: 3ed787238eab20a6fd720c10e30613186fc6c778
5
5
  SHA512:
6
- metadata.gz: db7827c87c482dab2e0a1e8852ba3c7d67f60d87954e799ceb1eb3001d7bbb09a54da74a7f18cd6e46686f0f9fefbec47820470c581cbc96d8c91d5634896c5a
7
- data.tar.gz: 27ad4037efaae00d19654a9409992e08297864eac2bdd3482502f676e48480744a644c1b8f169e7fc274e958a004d3a25249556ca31e69eabc1498d66c1330f8
6
+ metadata.gz: c25024cd8bd7311b47022c8981a39869b33a0a1e3f2bd450c0e9a6f1476da79fdb8ade0eb8ee5f512cd7954a63d36ec46ecc12c60b520052b66de29072a36ebd
7
+ data.tar.gz: 7a0ce5d3166b547ef0bbe32ef9823f9333761fa156dd937331b46914a211c3000943896b058e63a5c39cf6a1373eae8e8552dd27187556502fbf194c578649e8
@@ -11,4 +11,4 @@ RSpec/ContextWording:
11
11
  Enabled: false
12
12
 
13
13
  AllCops:
14
- TargetRubyVersion: 2.1
14
+ TargetRubyVersion: 2.2
@@ -14,8 +14,8 @@ module Percy
14
14
  # end
15
15
  module Anywhere
16
16
  def self.run(server, assets_dir, assets_base_url = nil)
17
- unless ENV['PERCY_PROJECT'] && ENV['PERCY_TOKEN']
18
- raise 'Whoops! You need to setup the PERCY_PROJECT and PERCY_TOKEN environment variables.'
17
+ if ENV['PERCY_TOKEN'].nil?
18
+ raise 'Whoops! You need to setup the PERCY_TOKEN environment variable.'
19
19
  end
20
20
 
21
21
  ::Capybara.run_server = false
@@ -42,12 +42,7 @@ module Percy
42
42
 
43
43
  # Check that environment variables required for Percy::Client are set
44
44
  def required_environment_variables_set?
45
- if !ENV['PERCY_TOKEN'].nil? && ENV['PERCY_PROJECT'].nil?
46
- raise '[percy] It looks like you were trying to enable Percy because PERCY_TOKEN ' \
47
- 'is set, but you are missing the PERCY_PROJECT environment variable!'
48
- end
49
-
50
- !(ENV['PERCY_PROJECT'].nil? || ENV['PERCY_TOKEN'].nil?)
45
+ !!ENV['PERCY_TOKEN']
51
46
  end
52
47
 
53
48
  def enabled?
@@ -16,7 +16,7 @@ module Percy
16
16
  Percy.logger.debug { "All build resources loaded (#{Time.now - start}s)" }
17
17
 
18
18
  rescue_connection_failures do
19
- @current_build = client.create_build(client.config.repo, options)
19
+ @current_build = client.create_build(options)
20
20
  _upload_missing_build_resources(build_resources) unless build_resources.empty?
21
21
  end
22
22
  if failed?
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Capybara
3
- VERSION = '3.1.2'.freeze
3
+ VERSION = '3.2.0'.freeze
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'percy-client', '~> 1.13'
21
+ spec.add_dependency 'percy-client', '~> 2.0'
22
22
  spec.add_dependency 'addressable', '~> 2'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.7'
@@ -1,9 +1,7 @@
1
1
  RSpec.describe Percy::Capybara::Client::Builds do
2
2
  let(:enabled) { true }
3
3
  let(:capybara_client) { Percy::Capybara::Client.new(enabled: enabled) }
4
- let(:builds_api_url) do
5
- "https://percy.io/api/v1/repos/#{Percy::Client::Environment.repo}/builds/"
6
- end
4
+ let(:builds_api_url) { "https://percy.io/api/v1/builds/" }
7
5
 
8
6
  describe '#initialize_build', type: :feature, js: true do
9
7
  before(:each) { setup_sprockets(capybara_client) }
@@ -104,7 +102,7 @@ RSpec.describe Percy::Capybara::Client::Builds do
104
102
  it 'returns the current build' do
105
103
  mock_double = double('build')
106
104
  expect(capybara_client.client).to receive(:create_build)
107
- .with(capybara_client.client.config.repo, {})
105
+ .with({})
108
106
  .and_return(mock_double)
109
107
  .once
110
108
  capybara_client.initialize_build
@@ -1 +1 @@
1
- spec/lib/percy/capybara/client/rails_public_test_data/../symlink_test_data
1
+ ../symlink_test_data
@@ -47,8 +47,7 @@ RSpec.describe Percy::Capybara::Client::Snapshots, type: :feature do
47
47
 
48
48
  visit '/'
49
49
  loader # Force evaluation now.
50
- repo = Percy::Client::Environment.repo
51
- stub_request(:post, "https://percy.io/api/v1/repos/#{repo}/builds/")
50
+ stub_request(:post, "https://percy.io/api/v1/builds/")
52
51
  .to_return(status: 201, body: mock_build_response.to_json)
53
52
  stub_request(:post, 'https://percy.io/api/v1/builds/123/snapshots/')
54
53
  .to_return(status: 201, body: mock_snapshot_response.to_json)
@@ -19,9 +19,9 @@ RSpec.describe Percy::Capybara::Client do
19
19
  expect(Percy::Capybara::Client.new.enabled?).to eq(false)
20
20
  end
21
21
 
22
- it 'raises error if PERCY_TOKEN is set but PERCY_PROJECT is not' do
23
- ENV.delete 'PERCY_PROJECT'
24
- expect { Percy::Capybara::Client.new.enabled? }.to raise_error(RuntimeError)
22
+ it 'is false if PERCY_TOKEN is not set' do
23
+ ENV.delete 'PERCY_TOKEN'
24
+ expect(Percy::Capybara::Client.new.enabled?).to eq(false)
25
25
  end
26
26
  end
27
27
 
@@ -50,13 +50,11 @@ module TestHelpers
50
50
  # Set the environment variables required by Percy::Client
51
51
  def set_required_env_variables
52
52
  ENV['PERCY_TOKEN'] = 'aa'
53
- ENV['PERCY_PROJECT'] = 'aa'
54
53
  end
55
54
 
56
55
  # Clear the environment variables required by Percy::Client
57
56
  def clear_percy_env_variables
58
57
  ENV.delete('PERCY_TOKEN')
59
- ENV.delete('PERCY_PROJECT')
60
58
  ENV.delete('PERCY_ENABLE')
61
59
  end
62
60
  end
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: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-24 00:00:00.000000000 Z
11
+ date: 2018-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: percy-client
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.13'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.13'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: addressable
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
311
311
  version: '0'
312
312
  requirements: []
313
313
  rubyforge_project:
314
- rubygems_version: 2.6.13
314
+ rubygems_version: 2.5.2
315
315
  signing_key:
316
316
  specification_version: 4
317
317
  summary: Percy::Capybara