frameworks-capybara 0.2.34 → 0.3.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -6
- data/Gemfile.lock +50 -60
- data/README.rdoc +3 -22
- data/frameworks-capybara.gemspec +4 -17
- data/lib/frameworks/capybara.rb +13 -63
- data/lib/frameworks/cucumber.rb +25 -84
- data/lib/monkey-patches/capybara-mechanize-patches.rb +9 -36
- data/lib/monkey-patches/capybara-patches.rb +1 -7
- data/lib/monkey-patches/cucumber-patches.rb +1 -5
- data/lib/monkey-patches/mechanize-patches.rb +2 -123
- data/lib/monkey-patches/webdriver-patches.rb +2 -31
- data/lib/tasks/frameworks-tasks.rb +1 -1
- data/lib/version.rb +2 -1
- data/spec/frameworks_capybara_spec.rb +22 -191
- data/spec/frameworks_cucumber_spec.rb +3 -160
- data/spec/spec_helper.rb +0 -2
- metadata +37 -153
- data/.travis.yml +0 -8
- data/CHANGES +0 -47
- data/lib/monkey-patches/net-http-persistent-patches.rb +0 -72
- data/spec/capybara_mechanize_patches_spec.rb +0 -124
- data/spec/mock.default/prefs.js +0 -10
- data/spec/profiles.ini +0 -8
- data/spec/unit_test_monkeypatches.rb +0 -17
@@ -1,124 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'rspec/mocks/mock'
|
3
|
-
require 'uri'
|
4
|
-
|
5
|
-
describe Capybara::Mechanize::Browser do
|
6
|
-
|
7
|
-
RSpec::Mocks::setup(self)
|
8
|
-
|
9
|
-
it "shouldn't send referer if unknown" do
|
10
|
-
|
11
|
-
agent = double()
|
12
|
-
agent.stub('get' => true)
|
13
|
-
agent.should_receive('get').with(
|
14
|
-
"http://example.bbc.co.uk/test",
|
15
|
-
{},
|
16
|
-
nil,
|
17
|
-
{}
|
18
|
-
)
|
19
|
-
|
20
|
-
driver = double("Capybara::Mechanize::Driver")
|
21
|
-
|
22
|
-
browser = Capybara::Mechanize::Browser.new(driver)
|
23
|
-
browser.stub('current_url' => "")
|
24
|
-
browser.stub('agent' => agent)
|
25
|
-
|
26
|
-
browser.process_remote_request(:get, 'http://example.bbc.co.uk/test', {}, {})
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should not change behaviour for POST requests" do
|
30
|
-
|
31
|
-
agent = double()
|
32
|
-
agent.stub('post' => true)
|
33
|
-
agent.should_receive('post').with("http://example.bbc.co.uk/test")
|
34
|
-
|
35
|
-
driver = double("Capybara::Mechanize::Driver")
|
36
|
-
|
37
|
-
browser = Capybara::Mechanize::Browser.new(driver)
|
38
|
-
browser.stub('current_url' => "http://example.bbc.co.uk/blah")
|
39
|
-
browser.stub('agent' => agent)
|
40
|
-
|
41
|
-
browser.process_remote_request(:post, 'http://example.bbc.co.uk/test', {}, {})
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should not send referer for requests from HTTPs to HTTP" do
|
45
|
-
|
46
|
-
agent = double()
|
47
|
-
agent.stub('get' => true)
|
48
|
-
agent.should_receive('get').with(
|
49
|
-
"http://example.bbc.co.uk/test",
|
50
|
-
{},
|
51
|
-
nil,
|
52
|
-
{}
|
53
|
-
)
|
54
|
-
|
55
|
-
driver = double("Capybara::Mechanize::Driver")
|
56
|
-
|
57
|
-
browser = Capybara::Mechanize::Browser.new(driver)
|
58
|
-
browser.stub('current_url' => "https://example.bbc.co.uk/blah")
|
59
|
-
browser.stub('agent' => agent)
|
60
|
-
|
61
|
-
browser.process_remote_request(:get, 'http://example.bbc.co.uk/test', {}, {})
|
62
|
-
end
|
63
|
-
|
64
|
-
it "should send referer for requests from HTTP to HTTPs" do
|
65
|
-
|
66
|
-
agent = double()
|
67
|
-
agent.stub('get' => true)
|
68
|
-
agent.should_receive('get').with(
|
69
|
-
"https://example.bbc.co.uk/test",
|
70
|
-
{},
|
71
|
-
"http://example.bbc.co.uk/blah",
|
72
|
-
{}
|
73
|
-
)
|
74
|
-
|
75
|
-
driver = double("Capybara::Mechanize::Driver")
|
76
|
-
|
77
|
-
browser = Capybara::Mechanize::Browser.new(driver)
|
78
|
-
browser.stub('current_url' => "http://example.bbc.co.uk/blah")
|
79
|
-
browser.stub('agent' => agent)
|
80
|
-
|
81
|
-
browser.process_remote_request(:get, 'https://example.bbc.co.uk/test', {}, {})
|
82
|
-
end
|
83
|
-
|
84
|
-
it "should send referer for requests from HTTP to HTTP" do
|
85
|
-
|
86
|
-
agent = double()
|
87
|
-
agent.stub('get' => true)
|
88
|
-
agent.should_receive('get').with(
|
89
|
-
"http://example.bbc.co.uk/test",
|
90
|
-
{},
|
91
|
-
"http://example.bbc.co.uk/blah",
|
92
|
-
{}
|
93
|
-
)
|
94
|
-
|
95
|
-
driver = double("Capybara::Mechanize::Driver")
|
96
|
-
|
97
|
-
browser = Capybara::Mechanize::Browser.new(driver)
|
98
|
-
browser.stub('current_url' => "http://example.bbc.co.uk/blah")
|
99
|
-
browser.stub('agent' => agent)
|
100
|
-
|
101
|
-
browser.process_remote_request(:get, 'http://example.bbc.co.uk/test', {}, {})
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should send referer for requests from HTTPs to HTTPs" do
|
105
|
-
|
106
|
-
agent = double()
|
107
|
-
agent.stub('get' => true)
|
108
|
-
agent.should_receive('get').with(
|
109
|
-
"https://example.bbc.co.uk/test",
|
110
|
-
{},
|
111
|
-
"https://example.bbc.co.uk/blah",
|
112
|
-
{}
|
113
|
-
)
|
114
|
-
|
115
|
-
driver = double("Capybara::Mechanize::Driver")
|
116
|
-
|
117
|
-
browser = Capybara::Mechanize::Browser.new(driver)
|
118
|
-
browser.stub('current_url' => "https://example.bbc.co.uk/blah")
|
119
|
-
browser.stub('agent' => agent)
|
120
|
-
|
121
|
-
browser.process_remote_request(:get, 'https://example.bbc.co.uk/test', {}, {})
|
122
|
-
end
|
123
|
-
|
124
|
-
end
|
data/spec/mock.default/prefs.js
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# Mozilla User Preferences
|
2
|
-
|
3
|
-
/* Do not edit this file.
|
4
|
-
*
|
5
|
-
* If you make changes to this file while the application is running,
|
6
|
-
* the changes will be overwritten when the application exits.
|
7
|
-
*
|
8
|
-
* To make a manual change to preferences, you can visit the URL about:config
|
9
|
-
* For more information, see http://www.mozilla.org/unix/customizing.html#prefs
|
10
|
-
*/
|
data/spec/profiles.ini
DELETED