capybara-mechanize 1.10.1 → 1.11.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: fac6d6b89beecdd33ed71713054e9cbd050628d4
4
- data.tar.gz: 8ae6b1fc58d4297a814ae3c48af443b93ac6fd71
3
+ metadata.gz: dbbe70531f05f681ac4c56ae6d96cd898a587e45
4
+ data.tar.gz: 7b7379c6df3f28286dc5411cf84eb63deabd0b62
5
5
  SHA512:
6
- metadata.gz: 0621533dcd84882381f6bb8628cb1b9831b4ddd737b825641b10b1dc04588cd73d04b13105e14147b123d030dd07fc386bd21160497a5569bf17de0ce5f77fbb
7
- data.tar.gz: 52c00e76830baf8c5c76cb8c978bd39baea65a58fef18f82d005944c53b0c8cb64726c7984f08832d09f026804c1398996cf49da0cf98b4820a91770fcfe1932
6
+ metadata.gz: 08a1b6c5c8c0215e7ca579ae2db481969fca4197f1d8e8996c701be9af2959101ac30fd482691009b659e61604793b890e0ce640e75b4d3fadd43a2d1e0922ec
7
+ data.tar.gz: 52cca002ee97c62fc9da48297119b32f85e096d17f04dda905c3afa6a21dedc583411b951a26ccc9491529b8bfb1b444f9cdc04f8b0a97e3e02d14568200b05f
@@ -56,6 +56,10 @@ When you want to use this driver to test a remote application. You have to set t
56
56
 
57
57
  Note that I haven't tested this case for my self yet. The Capybara tests pass for this situation though so it should work! Please provide me with feedback if it doesn't.
58
58
 
59
+ ### HTTP errors
60
+
61
+ If you receive the error `Net::HTTP::Persistent::Error: too many connection resets`, try setting a timeout value: `page.driver.browser.agent.idle_timeout = 0.4`.
62
+
59
63
  ## Running tests
60
64
 
61
65
  Run bundler
@@ -10,7 +10,7 @@ module Capybara::Mechanize
10
10
  [default_host].compact
11
11
  end
12
12
  end
13
-
13
+
14
14
  def local_hosts=(hosts)
15
15
  @local_hosts = hosts
16
16
  end
@@ -31,6 +31,10 @@ class Capybara::Mechanize::Browser < Capybara::RackTest::Browser
31
31
  last_request_remote? ? remote_response : super
32
32
  end
33
33
 
34
+ def last_request
35
+ last_request_remote? ? OpenStruct.new(request_method: @last_method, params: @last_params) : super
36
+ end
37
+
34
38
  # For each of these http methods, we want to intercept the method call.
35
39
  # Then we determine if the call is remote or local.
36
40
  # Remote: Handle it with our process_remote_request method.
@@ -19,4 +19,9 @@ class Capybara::Mechanize::Driver < Capybara::RackTest::Driver
19
19
  def browser
20
20
  @browser ||= Capybara::Mechanize::Browser.new(self)
21
21
  end
22
+
23
+ def reset!
24
+ @browser.agent.shutdown
25
+ super
26
+ end
22
27
  end
@@ -1,5 +1,5 @@
1
1
  module Capybara
2
2
  module Mechanize
3
- VERSION = '1.10.1'
3
+ VERSION = '1.11.0'
4
4
  end
5
5
  end
@@ -13,12 +13,12 @@ describe Capybara::Mechanize::Driver, 'remote' do
13
13
 
14
14
  context "in remote mode" do
15
15
  it "should pass arguments through to a get request" do
16
- driver.visit("#{remote_test_url}/form/get", {:form => "success"})
16
+ driver.visit("#{remote_test_url}/form/get", {:form => {:value => "success"}})
17
17
  driver.html.should include('success')
18
18
  end
19
19
 
20
20
  it "should pass arguments through to a post request" do
21
- driver.post("#{remote_test_url}/form", {:form => "success"})
21
+ driver.post("#{remote_test_url}/form", {:form => {:value => "success"}})
22
22
  driver.html.should include('success')
23
23
  end
24
24
 
@@ -13,7 +13,9 @@ Capybara::SpecHelper.run_specs TestSessions::Mechanize, "Mechanize", :capybara_s
13
13
  :hover,
14
14
  :modals,
15
15
  :about_scheme,
16
- :send_keys
16
+ :send_keys,
17
+ :css,
18
+ :download
17
19
  ]
18
20
 
19
21
  describe Capybara::Session do
@@ -23,7 +23,9 @@ session_describe = Capybara::SpecHelper.run_specs TestSessions::Mechanize, "Mech
23
23
  :hover,
24
24
  :modals,
25
25
  :about_scheme,
26
- :send_keys
26
+ :send_keys,
27
+ :css,
28
+ :download
27
29
  ]
28
30
 
29
31
  session_describe.include_context("remote tests")
@@ -9,10 +9,9 @@ $LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
9
9
  Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }
10
10
 
11
11
  RSpec.configure do |config|
12
- # This needs to remain commented out until there is a capybara release that includes https://github.com/jnicklas/capybara/pull/1078
13
- # config.filter_run :focus => true
12
+ config.filter_run :focus => true unless ENV['CI']
14
13
  config.run_all_when_everything_filtered = true
15
- config.treat_symbols_as_metadata_keys_with_true_values = true
14
+ config.treat_symbols_as_metadata_keys_with_true_values = true if RSpec::Version::STRING =~ /^2\./
16
15
 
17
16
  # Used with DisableExternalTests
18
17
  config.filter_run_excluding :external_test_disabled
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-mechanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeroen van Dijk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-16 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize