capybara 1.1.4 → 2.0.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.
- data/{History.txt → History.md} +138 -0
- data/License.txt +22 -0
- data/README.md +850 -0
- data/lib/capybara/cucumber.rb +2 -5
- data/lib/capybara/driver/base.rb +6 -6
- data/lib/capybara/driver/node.rb +3 -2
- data/lib/capybara/dsl.rb +13 -124
- data/lib/capybara/helpers.rb +33 -0
- data/lib/capybara/node/actions.rb +16 -30
- data/lib/capybara/node/base.rb +56 -13
- data/lib/capybara/node/element.rb +18 -30
- data/lib/capybara/node/finders.rb +28 -90
- data/lib/capybara/node/matchers.rb +121 -73
- data/lib/capybara/node/simple.rb +13 -11
- data/lib/capybara/query.rb +78 -0
- data/lib/capybara/rack_test/browser.rb +27 -39
- data/lib/capybara/rack_test/driver.rb +13 -3
- data/lib/capybara/rack_test/node.rb +31 -2
- data/lib/capybara/result.rb +72 -0
- data/lib/capybara/rspec/features.rb +4 -1
- data/lib/capybara/rspec/matchers.rb +33 -63
- data/lib/capybara/rspec.rb +7 -4
- data/lib/capybara/selector.rb +97 -34
- data/lib/capybara/selenium/driver.rb +15 -62
- data/lib/capybara/selenium/node.rb +14 -21
- data/lib/capybara/server.rb +32 -27
- data/lib/capybara/session.rb +90 -50
- data/lib/capybara/spec/fixtures/another_test_file.txt +1 -0
- data/lib/capybara/spec/public/jquery-ui.js +791 -0
- data/lib/capybara/spec/public/jquery.js +9046 -0
- data/lib/capybara/spec/public/test.js +3 -0
- data/lib/capybara/spec/session/all_spec.rb +61 -59
- data/lib/capybara/spec/session/assert_selector.rb +123 -0
- data/lib/capybara/spec/session/attach_file_spec.rb +72 -55
- data/lib/capybara/spec/session/body_spec.rb +21 -0
- data/lib/capybara/spec/session/check_spec.rb +68 -48
- data/lib/capybara/spec/session/choose_spec.rb +32 -18
- data/lib/capybara/spec/session/click_button_spec.rb +263 -232
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +40 -29
- data/lib/capybara/spec/session/click_link_spec.rb +96 -96
- data/lib/capybara/spec/session/current_url_spec.rb +88 -10
- data/lib/capybara/spec/session/evaluate_script_spec.rb +6 -0
- data/lib/capybara/spec/session/execute_script_spec.rb +7 -0
- data/lib/capybara/spec/session/fill_in_spec.rb +119 -103
- data/lib/capybara/spec/session/find_button_spec.rb +16 -14
- data/lib/capybara/spec/session/find_by_id_spec.rb +16 -14
- data/lib/capybara/spec/session/find_field_spec.rb +23 -21
- data/lib/capybara/spec/session/find_link_spec.rb +15 -14
- data/lib/capybara/spec/session/find_spec.rb +93 -115
- data/lib/capybara/spec/session/first_spec.rb +51 -85
- data/lib/capybara/spec/session/has_button_spec.rb +22 -24
- data/lib/capybara/spec/session/has_css_spec.rb +190 -205
- data/lib/capybara/spec/session/has_field_spec.rb +170 -144
- data/lib/capybara/spec/session/has_link_spec.rb +26 -29
- data/lib/capybara/spec/session/has_select_spec.rb +161 -109
- data/lib/capybara/spec/session/has_selector_spec.rb +94 -100
- data/lib/capybara/spec/session/has_table_spec.rb +22 -88
- data/lib/capybara/spec/session/has_text_spec.rb +195 -0
- data/lib/capybara/spec/session/has_xpath_spec.rb +100 -96
- data/lib/capybara/spec/session/headers.rb +4 -17
- data/lib/capybara/spec/session/html_spec.rb +15 -0
- data/lib/capybara/spec/session/node_spec.rb +205 -0
- data/lib/capybara/spec/session/reset_session_spec.rb +42 -0
- data/lib/capybara/spec/session/response_code.rb +4 -17
- data/lib/capybara/spec/session/save_page_spec.rb +46 -0
- data/lib/capybara/spec/session/screenshot.rb +13 -0
- data/lib/capybara/spec/session/select_spec.rb +99 -88
- data/lib/capybara/spec/session/source_spec.rb +12 -0
- data/lib/capybara/spec/session/text_spec.rb +15 -12
- data/lib/capybara/spec/session/uncheck_spec.rb +22 -17
- data/lib/capybara/spec/session/unselect_spec.rb +69 -58
- data/lib/capybara/spec/session/visit_spec.rb +74 -0
- data/lib/capybara/spec/session/within_frame_spec.rb +31 -0
- data/lib/capybara/spec/session/within_spec.rb +118 -131
- data/lib/capybara/spec/session/within_window_spec.rb +38 -0
- data/lib/capybara/spec/spec_helper.rb +84 -0
- data/lib/capybara/spec/test_app.rb +32 -6
- data/lib/capybara/spec/views/form.erb +12 -10
- data/lib/capybara/spec/views/host_links.erb +2 -2
- data/lib/capybara/spec/views/tables.erb +6 -66
- data/lib/capybara/spec/views/with_html.erb +9 -4
- data/lib/capybara/spec/views/with_js.erb +11 -7
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara.rb +125 -6
- data/spec/basic_node_spec.rb +17 -5
- data/spec/capybara_spec.rb +9 -0
- data/spec/dsl_spec.rb +31 -17
- data/spec/rack_test_spec.rb +157 -0
- data/spec/result_spec.rb +51 -0
- data/spec/rspec/features_spec.rb +19 -2
- data/spec/rspec/matchers_spec.rb +170 -89
- data/spec/rspec_spec.rb +1 -3
- data/spec/selenium_spec.rb +53 -0
- data/spec/server_spec.rb +37 -25
- data/spec/spec_helper.rb +1 -30
- metadata +39 -31
- data/README.rdoc +0 -722
- data/lib/capybara/spec/driver.rb +0 -301
- data/lib/capybara/spec/session/current_host_spec.rb +0 -68
- data/lib/capybara/spec/session/has_content_spec.rb +0 -106
- data/lib/capybara/spec/session/javascript.rb +0 -306
- data/lib/capybara/spec/session.rb +0 -154
- data/lib/capybara/util/save_and_open_page.rb +0 -44
- data/lib/capybara/util/timeout.rb +0 -27
- data/spec/driver/rack_test_driver_spec.rb +0 -89
- data/spec/driver/selenium_driver_spec.rb +0 -37
- data/spec/save_and_open_page_spec.rb +0 -155
- data/spec/session/rack_test_session_spec.rb +0 -55
- data/spec/session/selenium_session_spec.rb +0 -26
- data/spec/string_spec.rb +0 -77
- data/spec/timeout_spec.rb +0 -28
|
@@ -1,243 +1,228 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
Capybara::SpecHelper.spec '#has_css?' do
|
|
2
|
+
before do
|
|
3
|
+
@session.visit('/with_html')
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
it "should be true if the given selector is on the page" do
|
|
7
|
+
@session.should have_css("p")
|
|
8
|
+
@session.should have_css("p a#foo")
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
it "should be false if the given selector is not on the page" do
|
|
12
|
+
@session.should_not have_css("abbr")
|
|
13
|
+
@session.should_not have_css("p a#doesnotexist")
|
|
14
|
+
@session.should_not have_css("p.nosuchclass")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "should respect scopes" do
|
|
18
|
+
@session.within "//p[@id='first']" do
|
|
19
|
+
@session.should have_css("a#foo")
|
|
20
|
+
@session.should_not have_css("a#red")
|
|
10
21
|
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it "should wait for content to appear", :requires => [:js] do
|
|
25
|
+
@session.visit('/with_js')
|
|
26
|
+
@session.click_link('Click me')
|
|
27
|
+
@session.should have_css("input[type='submit'][value='New Here']")
|
|
28
|
+
end
|
|
11
29
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@session.
|
|
15
|
-
@session.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
it "should respect scopes" do
|
|
19
|
-
@session.within "//p[@id='first']" do
|
|
20
|
-
@session.should have_css("a#foo")
|
|
21
|
-
@session.should_not have_css("a#red")
|
|
22
|
-
end
|
|
30
|
+
context "with between" do
|
|
31
|
+
it "should be true if the content occurs within the range given" do
|
|
32
|
+
@session.should have_css("p", :between => 1..4)
|
|
33
|
+
@session.should have_css("p a#foo", :between => 1..3)
|
|
34
|
+
@session.should have_css("p a.doesnotexist", :between => 0..8)
|
|
23
35
|
end
|
|
24
36
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
it "should be false if the content occurs more or fewer times than range" do
|
|
38
|
+
@session.should_not have_css("p", :between => 6..11 )
|
|
39
|
+
@session.should_not have_css("p a#foo", :between => 4..7)
|
|
40
|
+
@session.should_not have_css("p a.doesnotexist", :between => 3..8)
|
|
41
|
+
end
|
|
42
|
+
end
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
context "with count" do
|
|
45
|
+
it "should be true if the content occurs the given number of times" do
|
|
46
|
+
@session.should have_css("p", :count => 3)
|
|
47
|
+
@session.should have_css("p a#foo", :count => 1)
|
|
48
|
+
@session.should have_css("p a.doesnotexist", :count => 0)
|
|
49
|
+
end
|
|
35
50
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
it "should be false if the content occurs a different number of times than the given" do
|
|
52
|
+
@session.should_not have_css("p", :count => 6)
|
|
53
|
+
@session.should_not have_css("p a#foo", :count => 2)
|
|
54
|
+
@session.should_not have_css("p a.doesnotexist", :count => 1)
|
|
40
55
|
end
|
|
41
56
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
it "should coerce count to an integer" do
|
|
58
|
+
@session.should have_css("p", :count => "3")
|
|
59
|
+
@session.should have_css("p a#foo", :count => "1")
|
|
60
|
+
end
|
|
61
|
+
end
|
|
47
62
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
context "with maximum" do
|
|
64
|
+
it "should be true when content occurs same or fewer times than given" do
|
|
65
|
+
@session.should have_css("h2.head", :maximum => 5) # edge case
|
|
66
|
+
@session.should have_css("h2", :maximum => 10)
|
|
67
|
+
@session.should have_css("p a.doesnotexist", :maximum => 1)
|
|
68
|
+
@session.should have_css("p a.doesnotexist", :maximum => 0)
|
|
69
|
+
end
|
|
52
70
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
it "should be false when content occurs more times than given" do
|
|
72
|
+
@session.should_not have_css("h2.head", :maximum => 4) # edge case
|
|
73
|
+
@session.should_not have_css("h2", :maximum => 6)
|
|
74
|
+
@session.should_not have_css("p", :maximum => 1)
|
|
75
|
+
end
|
|
57
76
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
end
|
|
77
|
+
it "should coerce maximum to an integer" do
|
|
78
|
+
@session.should have_css("h2.head", :maximum => "5") # edge case
|
|
79
|
+
@session.should have_css("h2", :maximum => "10")
|
|
62
80
|
end
|
|
81
|
+
end
|
|
63
82
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
83
|
+
context "with minimum" do
|
|
84
|
+
it "should be true when content occurs same or more times than given" do
|
|
85
|
+
@session.should have_css("h2.head", :minimum => 5) # edge case
|
|
86
|
+
@session.should have_css("h2", :minimum => 3)
|
|
87
|
+
@session.should have_css("p a.doesnotexist", :minimum => 0)
|
|
88
|
+
end
|
|
69
89
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
90
|
+
it "should be false when content occurs fewer times than given" do
|
|
91
|
+
@session.should_not have_css("h2.head", :minimum => 6) # edge case
|
|
92
|
+
@session.should_not have_css("h2", :minimum => 8)
|
|
93
|
+
@session.should_not have_css("p", :minimum => 10)
|
|
94
|
+
@session.should_not have_css("p a.doesnotexist", :minimum => 1)
|
|
95
|
+
end
|
|
75
96
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
97
|
+
it "should coerce minimum to an integer" do
|
|
98
|
+
@session.should have_css("h2.head", :minimum => "5") # edge case
|
|
99
|
+
@session.should have_css("h2", :minimum => "3")
|
|
100
|
+
end
|
|
101
|
+
end
|
|
80
102
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
context "with text" do
|
|
104
|
+
it "should discard all matches where the given string is not contained" do
|
|
105
|
+
@session.should have_css("p a", :text => "Redirect", :count => 1)
|
|
106
|
+
@session.should_not have_css("p a", :text => "Doesnotexist")
|
|
85
107
|
end
|
|
86
108
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
it "should discard all matches where the given regexp is not matched" do
|
|
110
|
+
@session.should have_css("p a", :text => /re[dab]i/i, :count => 1)
|
|
111
|
+
@session.should_not have_css("p a", :text => /Red$/)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
92
115
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
116
|
+
Capybara::SpecHelper.spec '#has_no_css?' do
|
|
117
|
+
before do
|
|
118
|
+
@session.visit('/with_html')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it "should be false if the given selector is on the page" do
|
|
122
|
+
@session.should_not have_no_css("p")
|
|
123
|
+
@session.should_not have_no_css("p a#foo")
|
|
124
|
+
end
|
|
98
125
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
126
|
+
it "should be true if the given selector is not on the page" do
|
|
127
|
+
@session.should have_no_css("abbr")
|
|
128
|
+
@session.should have_no_css("p a#doesnotexist")
|
|
129
|
+
@session.should have_no_css("p.nosuchclass")
|
|
130
|
+
end
|
|
103
131
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
132
|
+
it "should respect scopes" do
|
|
133
|
+
@session.within "//p[@id='first']" do
|
|
134
|
+
@session.should_not have_no_css("a#foo")
|
|
135
|
+
@session.should have_no_css("a#red")
|
|
108
136
|
end
|
|
137
|
+
end
|
|
109
138
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
139
|
+
it "should wait for content to disappear", :requires => [:js] do
|
|
140
|
+
@session.visit('/with_js')
|
|
141
|
+
@session.click_link('Click me')
|
|
142
|
+
@session.should have_no_css("p#change")
|
|
143
|
+
end
|
|
115
144
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
describe '#has_no_css?' do
|
|
124
|
-
before do
|
|
125
|
-
@session.visit('/with_html')
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
it "should be false if the given selector is on the page" do
|
|
129
|
-
@session.should_not have_no_css("p")
|
|
130
|
-
@session.should_not have_no_css("p a#foo")
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
it "should be true if the given selector is not on the page" do
|
|
134
|
-
@session.should have_no_css("abbr")
|
|
135
|
-
@session.should have_no_css("p a#doesnotexist")
|
|
136
|
-
@session.should have_no_css("p.nosuchclass")
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
it "should respect scopes" do
|
|
140
|
-
@session.within "//p[@id='first']" do
|
|
141
|
-
@session.should_not have_no_css("a#foo")
|
|
142
|
-
@session.should have_no_css("a#red")
|
|
143
|
-
end
|
|
144
|
-
end
|
|
145
|
-
|
|
146
|
-
context "with between" do
|
|
147
|
-
it "should be false if the content occurs within the range given" do
|
|
148
|
-
@session.should_not have_no_css("p", :between => 1..4)
|
|
149
|
-
@session.should_not have_no_css("p a#foo", :between => 1..3)
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
it "should be true if the content occurs more or fewer times than range" do
|
|
153
|
-
@session.should have_no_css("p", :between => 6..11 )
|
|
154
|
-
@session.should have_no_css("p a#foo", :between => 4..7)
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
it "should be true if the content isn't on the page at all" do
|
|
158
|
-
@session.should have_no_css("abbr", :between => 1..8)
|
|
159
|
-
@session.should have_no_css("p a.doesnotexist", :between => 3..8)
|
|
160
|
-
end
|
|
161
|
-
end
|
|
145
|
+
context "with between" do
|
|
146
|
+
it "should be false if the content occurs within the range given" do
|
|
147
|
+
@session.should_not have_no_css("p", :between => 1..4)
|
|
148
|
+
@session.should_not have_no_css("p a#foo", :between => 1..3)
|
|
149
|
+
@session.should_not have_no_css("p a.doesnotexist", :between => 0..2)
|
|
150
|
+
end
|
|
162
151
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
it "should be true if the content is on the page the given number of times" do
|
|
170
|
-
@session.should have_no_css("p", :count => 6)
|
|
171
|
-
@session.should have_no_css("p a#foo", :count => 2)
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
it "should be true if the content isn't on the page at all" do
|
|
175
|
-
@session.should have_no_css("abbr", :count => 2)
|
|
176
|
-
@session.should have_no_css("p a.doesnotexist", :count => 1)
|
|
177
|
-
end
|
|
152
|
+
it "should be true if the content occurs more or fewer times than range" do
|
|
153
|
+
@session.should have_no_css("p", :between => 6..11 )
|
|
154
|
+
@session.should have_no_css("p a#foo", :between => 4..7)
|
|
155
|
+
@session.should have_no_css("p a.doesnotexist", :between => 3..8)
|
|
156
|
+
end
|
|
157
|
+
end
|
|
178
158
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
159
|
+
context "with count" do
|
|
160
|
+
it "should be false if the content is on the page the given number of times" do
|
|
161
|
+
@session.should_not have_no_css("p", :count => 3)
|
|
162
|
+
@session.should_not have_no_css("p a#foo", :count => 1)
|
|
163
|
+
@session.should_not have_no_css("p a.doesnotexist", :count => 0)
|
|
183
164
|
end
|
|
184
165
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
166
|
+
it "should be true if the content is on the page the given number of times" do
|
|
167
|
+
@session.should have_no_css("p", :count => 6)
|
|
168
|
+
@session.should have_no_css("p a#foo", :count => 2)
|
|
169
|
+
@session.should have_no_css("p a.doesnotexist", :count => 1)
|
|
170
|
+
end
|
|
190
171
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
172
|
+
it "should coerce count to an integer" do
|
|
173
|
+
@session.should_not have_no_css("p", :count => "3")
|
|
174
|
+
@session.should_not have_no_css("p a#foo", :count => "1")
|
|
175
|
+
end
|
|
176
|
+
end
|
|
196
177
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
178
|
+
context "with maximum" do
|
|
179
|
+
it "should be false when content occurs same or fewer times than given" do
|
|
180
|
+
@session.should_not have_no_css("h2.head", :maximum => 5) # edge case
|
|
181
|
+
@session.should_not have_no_css("h2", :maximum => 10)
|
|
182
|
+
@session.should_not have_no_css("p a.doesnotexist", :maximum => 0)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
it "should be true when content occurs more times than given" do
|
|
186
|
+
@session.should have_no_css("h2.head", :maximum => 4) # edge case
|
|
187
|
+
@session.should have_no_css("h2", :maximum => 6)
|
|
188
|
+
@session.should have_no_css("p", :maximum => 1)
|
|
189
|
+
end
|
|
201
190
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
end
|
|
191
|
+
it "should coerce maximum to an integer" do
|
|
192
|
+
@session.should_not have_no_css("h2.head", :maximum => "5") # edge case
|
|
193
|
+
@session.should_not have_no_css("h2", :maximum => "10")
|
|
206
194
|
end
|
|
195
|
+
end
|
|
207
196
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
197
|
+
context "with minimum" do
|
|
198
|
+
it "should be false when content occurs same or more times than given" do
|
|
199
|
+
@session.should_not have_no_css("h2.head", :minimum => 5) # edge case
|
|
200
|
+
@session.should_not have_no_css("h2", :minimum => 3)
|
|
201
|
+
@session.should_not have_no_css("p a.doesnotexist", :minimum => 0)
|
|
202
|
+
end
|
|
213
203
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
204
|
+
it "should be true when content occurs fewer times than given" do
|
|
205
|
+
@session.should have_no_css("h2.head", :minimum => 6) # edge case
|
|
206
|
+
@session.should have_no_css("h2", :minimum => 8)
|
|
207
|
+
@session.should have_no_css("p", :minimum => 15)
|
|
208
|
+
@session.should have_no_css("p a.doesnotexist", :minimum => 1)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
it "should coerce minimum to an integer" do
|
|
212
|
+
@session.should_not have_no_css("h2.head", :minimum => "4") # edge case
|
|
213
|
+
@session.should_not have_no_css("h2", :minimum => "3")
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
context "with text" do
|
|
218
|
+
it "should discard all matches where the given string is not contained" do
|
|
219
|
+
@session.should_not have_no_css("p a", :text => "Redirect", :count => 1)
|
|
220
|
+
@session.should have_no_css("p a", :text => "Doesnotexist")
|
|
221
|
+
end
|
|
219
222
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
it "should coerce minimum to an integer" do
|
|
226
|
-
@session.should_not have_no_css("h2.head", :minimum => "4") # edge case
|
|
227
|
-
@session.should_not have_no_css("h2", :minimum => "3")
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
context "with text" do
|
|
232
|
-
it "should discard all matches where the given string is not contained" do
|
|
233
|
-
@session.should_not have_no_css("p a", :text => "Redirect", :count => 1)
|
|
234
|
-
@session.should have_no_css("p a", :text => "Doesnotexist")
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
it "should discard all matches where the given regexp is not matched" do
|
|
238
|
-
@session.should_not have_no_css("p a", :text => /re[dab]i/i, :count => 1)
|
|
239
|
-
@session.should have_no_css("p a", :text => /Red$/)
|
|
240
|
-
end
|
|
223
|
+
it "should discard all matches where the given regexp is not matched" do
|
|
224
|
+
@session.should_not have_no_css("p a", :text => /re[dab]i/i, :count => 1)
|
|
225
|
+
@session.should have_no_css("p a", :text => /Red$/)
|
|
241
226
|
end
|
|
242
227
|
end
|
|
243
228
|
end
|