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.
Files changed (111) hide show
  1. data/{History.txt → History.md} +138 -0
  2. data/License.txt +22 -0
  3. data/README.md +850 -0
  4. data/lib/capybara/cucumber.rb +2 -5
  5. data/lib/capybara/driver/base.rb +6 -6
  6. data/lib/capybara/driver/node.rb +3 -2
  7. data/lib/capybara/dsl.rb +13 -124
  8. data/lib/capybara/helpers.rb +33 -0
  9. data/lib/capybara/node/actions.rb +16 -30
  10. data/lib/capybara/node/base.rb +56 -13
  11. data/lib/capybara/node/element.rb +18 -30
  12. data/lib/capybara/node/finders.rb +28 -90
  13. data/lib/capybara/node/matchers.rb +121 -73
  14. data/lib/capybara/node/simple.rb +13 -11
  15. data/lib/capybara/query.rb +78 -0
  16. data/lib/capybara/rack_test/browser.rb +27 -39
  17. data/lib/capybara/rack_test/driver.rb +13 -3
  18. data/lib/capybara/rack_test/node.rb +31 -2
  19. data/lib/capybara/result.rb +72 -0
  20. data/lib/capybara/rspec/features.rb +4 -1
  21. data/lib/capybara/rspec/matchers.rb +33 -63
  22. data/lib/capybara/rspec.rb +7 -4
  23. data/lib/capybara/selector.rb +97 -34
  24. data/lib/capybara/selenium/driver.rb +15 -62
  25. data/lib/capybara/selenium/node.rb +14 -21
  26. data/lib/capybara/server.rb +32 -27
  27. data/lib/capybara/session.rb +90 -50
  28. data/lib/capybara/spec/fixtures/another_test_file.txt +1 -0
  29. data/lib/capybara/spec/public/jquery-ui.js +791 -0
  30. data/lib/capybara/spec/public/jquery.js +9046 -0
  31. data/lib/capybara/spec/public/test.js +3 -0
  32. data/lib/capybara/spec/session/all_spec.rb +61 -59
  33. data/lib/capybara/spec/session/assert_selector.rb +123 -0
  34. data/lib/capybara/spec/session/attach_file_spec.rb +72 -55
  35. data/lib/capybara/spec/session/body_spec.rb +21 -0
  36. data/lib/capybara/spec/session/check_spec.rb +68 -48
  37. data/lib/capybara/spec/session/choose_spec.rb +32 -18
  38. data/lib/capybara/spec/session/click_button_spec.rb +263 -232
  39. data/lib/capybara/spec/session/click_link_or_button_spec.rb +40 -29
  40. data/lib/capybara/spec/session/click_link_spec.rb +96 -96
  41. data/lib/capybara/spec/session/current_url_spec.rb +88 -10
  42. data/lib/capybara/spec/session/evaluate_script_spec.rb +6 -0
  43. data/lib/capybara/spec/session/execute_script_spec.rb +7 -0
  44. data/lib/capybara/spec/session/fill_in_spec.rb +119 -103
  45. data/lib/capybara/spec/session/find_button_spec.rb +16 -14
  46. data/lib/capybara/spec/session/find_by_id_spec.rb +16 -14
  47. data/lib/capybara/spec/session/find_field_spec.rb +23 -21
  48. data/lib/capybara/spec/session/find_link_spec.rb +15 -14
  49. data/lib/capybara/spec/session/find_spec.rb +93 -115
  50. data/lib/capybara/spec/session/first_spec.rb +51 -85
  51. data/lib/capybara/spec/session/has_button_spec.rb +22 -24
  52. data/lib/capybara/spec/session/has_css_spec.rb +190 -205
  53. data/lib/capybara/spec/session/has_field_spec.rb +170 -144
  54. data/lib/capybara/spec/session/has_link_spec.rb +26 -29
  55. data/lib/capybara/spec/session/has_select_spec.rb +161 -109
  56. data/lib/capybara/spec/session/has_selector_spec.rb +94 -100
  57. data/lib/capybara/spec/session/has_table_spec.rb +22 -88
  58. data/lib/capybara/spec/session/has_text_spec.rb +195 -0
  59. data/lib/capybara/spec/session/has_xpath_spec.rb +100 -96
  60. data/lib/capybara/spec/session/headers.rb +4 -17
  61. data/lib/capybara/spec/session/html_spec.rb +15 -0
  62. data/lib/capybara/spec/session/node_spec.rb +205 -0
  63. data/lib/capybara/spec/session/reset_session_spec.rb +42 -0
  64. data/lib/capybara/spec/session/response_code.rb +4 -17
  65. data/lib/capybara/spec/session/save_page_spec.rb +46 -0
  66. data/lib/capybara/spec/session/screenshot.rb +13 -0
  67. data/lib/capybara/spec/session/select_spec.rb +99 -88
  68. data/lib/capybara/spec/session/source_spec.rb +12 -0
  69. data/lib/capybara/spec/session/text_spec.rb +15 -12
  70. data/lib/capybara/spec/session/uncheck_spec.rb +22 -17
  71. data/lib/capybara/spec/session/unselect_spec.rb +69 -58
  72. data/lib/capybara/spec/session/visit_spec.rb +74 -0
  73. data/lib/capybara/spec/session/within_frame_spec.rb +31 -0
  74. data/lib/capybara/spec/session/within_spec.rb +118 -131
  75. data/lib/capybara/spec/session/within_window_spec.rb +38 -0
  76. data/lib/capybara/spec/spec_helper.rb +84 -0
  77. data/lib/capybara/spec/test_app.rb +32 -6
  78. data/lib/capybara/spec/views/form.erb +12 -10
  79. data/lib/capybara/spec/views/host_links.erb +2 -2
  80. data/lib/capybara/spec/views/tables.erb +6 -66
  81. data/lib/capybara/spec/views/with_html.erb +9 -4
  82. data/lib/capybara/spec/views/with_js.erb +11 -7
  83. data/lib/capybara/version.rb +1 -1
  84. data/lib/capybara.rb +125 -6
  85. data/spec/basic_node_spec.rb +17 -5
  86. data/spec/capybara_spec.rb +9 -0
  87. data/spec/dsl_spec.rb +31 -17
  88. data/spec/rack_test_spec.rb +157 -0
  89. data/spec/result_spec.rb +51 -0
  90. data/spec/rspec/features_spec.rb +19 -2
  91. data/spec/rspec/matchers_spec.rb +170 -89
  92. data/spec/rspec_spec.rb +1 -3
  93. data/spec/selenium_spec.rb +53 -0
  94. data/spec/server_spec.rb +37 -25
  95. data/spec/spec_helper.rb +1 -30
  96. metadata +39 -31
  97. data/README.rdoc +0 -722
  98. data/lib/capybara/spec/driver.rb +0 -301
  99. data/lib/capybara/spec/session/current_host_spec.rb +0 -68
  100. data/lib/capybara/spec/session/has_content_spec.rb +0 -106
  101. data/lib/capybara/spec/session/javascript.rb +0 -306
  102. data/lib/capybara/spec/session.rb +0 -154
  103. data/lib/capybara/util/save_and_open_page.rb +0 -44
  104. data/lib/capybara/util/timeout.rb +0 -27
  105. data/spec/driver/rack_test_driver_spec.rb +0 -89
  106. data/spec/driver/selenium_driver_spec.rb +0 -37
  107. data/spec/save_and_open_page_spec.rb +0 -155
  108. data/spec/session/rack_test_session_spec.rb +0 -55
  109. data/spec/session/selenium_session_spec.rb +0 -26
  110. data/spec/string_spec.rb +0 -77
  111. data/spec/timeout_spec.rb +0 -28
@@ -1,243 +1,228 @@
1
- shared_examples_for "has_css" do
2
- describe '#has_css?' do
3
- before do
4
- @session.visit('/with_html')
5
- end
6
-
7
- it "should be true if the given selector is on the page" do
8
- @session.should have_css("p")
9
- @session.should have_css("p a#foo")
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
- it "should be false if the given selector is not on the page" do
13
- @session.should_not have_css("abbr")
14
- @session.should_not have_css("p a#doesnotexist")
15
- @session.should_not have_css("p.nosuchclass")
16
- end
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
- context "with between" do
26
- it "should be true if the content occurs within the range given" do
27
- @session.should have_css("p", :between => 1..4)
28
- @session.should have_css("p a#foo", :between => 1..3)
29
- end
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
- it "should be false if the content occurs more or fewer times than range" do
32
- @session.should_not have_css("p", :between => 6..11 )
33
- @session.should_not have_css("p a#foo", :between => 4..7)
34
- end
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
- it "should be false if the content isn't on the page at all" do
37
- @session.should_not have_css("abbr", :between => 1..8)
38
- @session.should_not have_css("p a.doesnotexist", :between => 3..8)
39
- end
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
- context "with count" do
43
- it "should be true if the content is on the page the given number of times" do
44
- @session.should have_css("p", :count => 3)
45
- @session.should have_css("p a#foo", :count => 1)
46
- end
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
- it "should be false if the content occurs the given number of times" do
49
- @session.should_not have_css("p", :count => 6)
50
- @session.should_not have_css("p a#foo", :count => 2)
51
- end
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
- it "should be false if the content isn't on the page at all" do
54
- @session.should_not have_css("abbr", :count => 2)
55
- @session.should_not have_css("p a.doesnotexist", :count => 1)
56
- end
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
- it "should coerce count to an integer" do
59
- @session.should have_css("p", :count => "3")
60
- @session.should have_css("p a#foo", :count => "1")
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
- context "with maximum" do
65
- it "should be true when content occurs same or fewer times than given" do
66
- @session.should have_css("h2.head", :maximum => 5) # edge case
67
- @session.should have_css("h2", :maximum => 10)
68
- end
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
- it "should be false when content occurs more times than given" do
71
- @session.should_not have_css("h2.head", :maximum => 4) # edge case
72
- @session.should_not have_css("h2", :maximum => 6)
73
- @session.should_not have_css("p", :maximum => 1)
74
- end
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
- it "should be false if the content isn't on the page at all" do
77
- @session.should_not have_css("abbr", :maximum => 2)
78
- @session.should_not have_css("p a.doesnotexist", :maximum => 1)
79
- end
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
- it "should coerce maximum to an integer" do
82
- @session.should have_css("h2.head", :maximum => "5") # edge case
83
- @session.should have_css("h2", :maximum => "10")
84
- end
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
- context "with minimum" do
88
- it "should be true when content occurs same or more times than given" do
89
- @session.should have_css("h2.head", :minimum => 5) # edge case
90
- @session.should have_css("h2", :minimum => 3)
91
- end
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
- it "should be false when content occurs fewer times than given" do
94
- @session.should_not have_css("h2.head", :minimum => 6) # edge case
95
- @session.should_not have_css("h2", :minimum => 8)
96
- @session.should_not have_css("p", :minimum => 10)
97
- end
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
- it "should be false if the content isn't on the page at all" do
100
- @session.should_not have_css("abbr", :minimum => 2)
101
- @session.should_not have_css("p a.doesnotexist", :minimum => 7)
102
- end
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
- it "should coerce minimum to an integer" do
105
- @session.should have_css("h2.head", :minimum => "5") # edge case
106
- @session.should have_css("h2", :minimum => "3")
107
- end
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
- context "with text" do
111
- it "should discard all matches where the given string is not contained" do
112
- @session.should have_css("p a", :text => "Redirect", :count => 1)
113
- @session.should_not have_css("p a", :text => "Doesnotexist")
114
- end
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
- it "should discard all matches where the given regexp is not matched" do
117
- @session.should have_css("p a", :text => /re[dab]i/i, :count => 1)
118
- @session.should_not have_css("p a", :text => /Red$/)
119
- end
120
- end
121
- end
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
- context "with count" do
164
- it "should be false if the content is on the page the given number of times" do
165
- @session.should_not have_no_css("p", :count => 3)
166
- @session.should_not have_no_css("p a#foo", :count => 1)
167
- end
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
- it "should coerce count to an integer" do
180
- @session.should_not have_no_css("p", :count => "3")
181
- @session.should_not have_no_css("p a#foo", :count => "1")
182
- end
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
- context "with maximum" do
186
- it "should be false when content occurs same or fewer times than given" do
187
- @session.should_not have_no_css("h2.head", :maximum => 5) # edge case
188
- @session.should_not have_no_css("h2", :maximum => 10)
189
- end
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
- it "should be true when content occurs more times than given" do
192
- @session.should have_no_css("h2.head", :maximum => 4) # edge case
193
- @session.should have_no_css("h2", :maximum => 6)
194
- @session.should have_no_css("p", :maximum => 1)
195
- end
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
- it "should be true if the content isn't on the page at all" do
198
- @session.should have_no_css("abbr", :maximum => 5)
199
- @session.should have_no_css("p a.doesnotexist", :maximum => 10)
200
- end
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
- it "should coerce maximum to an integer" do
203
- @session.should_not have_no_css("h2.head", :maximum => "5") # edge case
204
- @session.should_not have_no_css("h2", :maximum => "10")
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
- context "with minimum" do
209
- it "should be false when content occurs more times than given" do
210
- @session.should_not have_no_css("h2.head", :minimum => 4) # edge case
211
- @session.should_not have_no_css("h2", :minimum => 3)
212
- end
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
- it "should be true when content occurs fewer times than given" do
215
- @session.should have_no_css("h2.head", :minimum => 6) # edge case
216
- @session.should have_no_css("h2", :minimum => 8)
217
- @session.should have_no_css("p", :minimum => 15)
218
- end
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
- it "should be true if the content isn't on the page at all" do
221
- @session.should have_no_css("abbr", :minimum => 5)
222
- @session.should have_no_css("p a.doesnotexist", :minimum => 10)
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