capybara-mechanize 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.mdown +4 -0
- data/lib/capybara/mechanize.rb +1 -1
- data/lib/capybara/mechanize/browser.rb +4 -0
- data/lib/capybara/mechanize/driver.rb +5 -0
- data/lib/capybara/mechanize/version.rb +1 -1
- data/spec/driver/remote_mechanize_driver_spec.rb +2 -2
- data/spec/session/mechanize_spec.rb +3 -1
- data/spec/session/remote_mechanize_spec.rb +3 -1
- data/spec/spec_helper.rb +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbbe70531f05f681ac4c56ae6d96cd898a587e45
|
4
|
+
data.tar.gz: 7b7379c6df3f28286dc5411cf84eb63deabd0b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08a1b6c5c8c0215e7ca579ae2db481969fca4197f1d8e8996c701be9af2959101ac30fd482691009b659e61604793b890e0ce640e75b4d3fadd43a2d1e0922ec
|
7
|
+
data.tar.gz: 52cca002ee97c62fc9da48297119b32f85e096d17f04dda905c3afa6a21dedc583411b951a26ccc9491529b8bfb1b444f9cdc04f8b0a97e3e02d14568200b05f
|
data/README.mdown
CHANGED
@@ -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
|
data/lib/capybara/mechanize.rb
CHANGED
@@ -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.
|
@@ -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
|
|
data/spec/spec_helper.rb
CHANGED
@@ -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
|
-
|
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.
|
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-
|
11
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|