minitest-rails-capybara 0.9.0 → 0.10.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8c02f46ffa275d51ed616bb69b7be360fe4e230e
4
+ data.tar.gz: ac5530d5768287977f22600b486f6328dc520208
5
+ SHA512:
6
+ metadata.gz: bfc7d1bbe7666878f5ef8c4e6c203a4e5fd8719ea9cd797ff453f703726614070de074b2aafe20fc5ec2aa02f2a03d54284be0a868117565338be7cbe1fa39a6
7
+ data.tar.gz: faaa2779f257b0cea66e8b80ea2161fbad0f5acca2d9c3cc64ae755f3af8c889e9937ae5b815519e3f19f79df8ab96419de05d07386deffc172e93ea5b8a5a29
data/CHANGELOG.rdoc CHANGED
@@ -1,13 +1,24 @@
1
+ === 0.10.0 / 2013-07-23
2
+
3
+ * Allow feature to work without "Feature Test"
4
+ * Call reset_sessions! after tests [closes #7]
5
+ * Add Capybara documentation
6
+
7
+
8
+ https://github.com/blowmage/minitest-rails-capybara/compare/v0.9...v0.10
9
+
1
10
  === 0.9.0 / 2013-03-18
2
11
 
3
- * Add minitest-metadata dependency
4
- * Move capybara spec into TestCase
5
- * Add instructions for running tests
6
- * Update install instructions
12
+ * Add minitest-metadata dependency
13
+ * Move capybara spec into TestCase
14
+ * Add instructions for running tests
15
+ * Update install instructions
16
+
17
+ https://github.com/blowmage/minitest-rails-capybara/compare/v0.5.1...v0.9
7
18
 
8
19
  === 0.5.1 / 2013-01-11
9
20
 
10
- * Add the Capybara spec DSL
21
+ * Add the Capybara spec DSL
11
22
 
12
23
  https://github.com/blowmage/minitest-rails-capybara/compare/v0.5...v0.5.1
13
24
 
data/Manifest.txt CHANGED
@@ -12,7 +12,7 @@ lib/minitest-rails-capybara.rb
12
12
  lib/minitest/rails/capybara.rb
13
13
  minitest-rails-capybara.gemspec
14
14
  test/rails_helper.rb
15
+ test/test_assertions_expectation.rb
15
16
  test/test_dsl.rb
16
- test/test_matchers.rb
17
17
  test/test_sanity.rb
18
18
  test/test_spec.rb
data/README.rdoc CHANGED
@@ -55,7 +55,7 @@ Which will generate a feature test using the Capybara spec DSL:
55
55
 
56
56
  require "minitest_helper"
57
57
 
58
- feature "Can Access Home Feature Test" do
58
+ feature "Can Access Home" do
59
59
  scenario "has content" do
60
60
  visit root_path
61
61
  assert page.has_content?("Home#index")
@@ -74,7 +74,7 @@ If you want Capybara within your integration tests, add the following to your <t
74
74
 
75
75
  Tests can specify drivers by setting the metadata.
76
76
 
77
- feature "Can Access Home Feature Test" do
77
+ feature "Can Access Home" do
78
78
  scenario "has content", js: true do
79
79
  visit root_path # Visited with JavaScript driver
80
80
  assert page.has_content?("Home#index")
data/Rakefile CHANGED
@@ -20,9 +20,8 @@ Hoe.spec 'minitest-rails-capybara' do
20
20
 
21
21
  dependency 'minitest-rails', '~> 0.9.1'
22
22
  dependency 'capybara', '~> 2.0'
23
- dependency 'minitest-capybara', '~> 0.1'
24
- dependency 'minitest-matchers', '~> 1.2'
25
- dependency 'minitest-metadata', '~> 0.3'
23
+ dependency 'minitest-capybara', '~> 0.4'
24
+ dependency 'minitest-metadata', '~> 0.4'
26
25
  end
27
26
 
28
27
  # vim: syntax=ruby
@@ -1,7 +1,6 @@
1
- require "minitest_helper"
1
+ require "test_helper"
2
2
 
3
- # To be handled correctly by Capybara this spec must end with "Feature Test"
4
- feature "<%= class_name %> Feature Test" do
3
+ feature "<%= class_name %>" do
5
4
  scenario "the test is sound" do
6
5
  visit root_path
7
6
  page.must_have_content "Hello World"
@@ -1,9 +1,9 @@
1
- require "minitest_helper"
1
+ require "test_helper"
2
2
 
3
3
  class <%= class_name %>Test < Capybara::Rails::TestCase
4
4
  test "sanity" do
5
5
  visit root_path
6
- assert_have_content page, "Hello World"
7
- refute_have_content page, "Goobye All!"
6
+ assert_content page, "Hello World"
7
+ refute_content page, "Goobye All!"
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ require "minitest-rails"
3
3
  module MiniTest
4
4
  module Rails
5
5
  module Capybara
6
- VERSION = "0.9.0"
6
+ VERSION = "0.10.0"
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  require "minitest/rails"
2
- # Load minitest-matchers and fix Capybara::RSpecMatchers
2
+ # Load minitest-capybara and minitest-matchers
3
3
  require "minitest-capybara"
4
4
  require "capybara/rails"
5
5
  require "minitest/metadata"
@@ -8,8 +8,8 @@ module Capybara
8
8
  module Rails
9
9
  class TestCase < ::ActiveSupport::TestCase
10
10
  include ::Rails.application.routes.url_helpers
11
- include Capybara::RSpecMatchers
12
11
  include Capybara::DSL
12
+ include Capybara::Assertions
13
13
  include MiniTest::Metadata
14
14
 
15
15
  # Register by name
@@ -30,12 +30,572 @@ module Capybara
30
30
  end
31
31
 
32
32
  after do
33
- Capybara.current_driver = Capybara.default_driver
33
+ Capybara.reset_sessions!
34
+ Capybara.use_default_driver
34
35
  end
35
36
  end
36
37
  end
37
38
  end
38
39
 
39
40
  module Kernel # :nodoc:
40
- alias :feature :describe
41
- end
41
+ def feature desc, &blk
42
+ describe "#{desc} Feature Test", &blk
43
+ end
44
+ end
45
+
46
+ module Capybara
47
+ module Assertions
48
+ def assert_have_button(*args) #:nodoc:
49
+ ActiveSupport::Deprecation.warn "assert_have_button is deprecated. Please use assert_button instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
50
+ assert_button(*args)
51
+ end
52
+ def assert_have_checked_field(*args) #:nodoc:
53
+ ActiveSupport::Deprecation.warn "assert_have_checked_field is deprecated. Please use assert_checked_field instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
54
+ assert_checked_field(*args)
55
+ end
56
+ def assert_have_content(*args) #:nodoc:
57
+ ActiveSupport::Deprecation.warn "assert_have_content is deprecated. Please use assert_content instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
58
+ assert_content(*args)
59
+ end
60
+ def assert_have_css(*args) #:nodoc:
61
+ ActiveSupport::Deprecation.warn "assert_have_css is deprecated. Please use assert_css instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
62
+ assert_css(*args)
63
+ end
64
+ def assert_have_field(*args) #:nodoc:
65
+ ActiveSupport::Deprecation.warn "assert_have_field is deprecated. Please use assert_field instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
66
+ assert_field(*args)
67
+ end
68
+ def assert_have_link(*args) #:nodoc:
69
+ ActiveSupport::Deprecation.warn "assert_have_link is deprecated. Please use assert_link instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
70
+ assert_link(*args)
71
+ end
72
+ def assert_have_select(*args) #:nodoc:
73
+ ActiveSupport::Deprecation.warn "assert_have_select is deprecated. Please use assert_select instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
74
+ assert_select(*args)
75
+ end
76
+ def assert_have_selector(*args) #:nodoc:
77
+ ActiveSupport::Deprecation.warn "assert_have_selector is deprecated. Please use assert_selector instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
78
+ assert_selector(*args)
79
+ end
80
+ def assert_have_table(*args) #:nodoc:
81
+ ActiveSupport::Deprecation.warn "assert_have_table is deprecated. Please use assert_table instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
82
+ assert_table(*args)
83
+ end
84
+ def assert_have_text(*args) #:nodoc:
85
+ ActiveSupport::Deprecation.warn "assert_have_text is deprecated. Please use assert_text instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
86
+ assert_text(*args)
87
+ end
88
+ def assert_have_unchecked_field(*args) #:nodoc:
89
+ ActiveSupport::Deprecation.warn "assert_have_unchecked_field is deprecated. Please use assert_unchecked_field instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
90
+ assert_unchecked_field(*args)
91
+ end
92
+ def assert_have_xpath(*args) #:nodoc:
93
+ ActiveSupport::Deprecation.warn "assert_have_xpath is deprecated. Please use assert_xpath instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
94
+ assert_xpath(*args)
95
+ end
96
+ def refute_have_button(*args) #:nodoc:
97
+ ActiveSupport::Deprecation.warn "refute_have_button is deprecated. Please use refute_button instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
98
+ refute_button(*args)
99
+ end
100
+ def refute_have_checked_field(*args) #:nodoc:
101
+ ActiveSupport::Deprecation.warn "refute_have_checked_field is deprecated. Please use refute_checked_field instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
102
+ refute_checked_field(*args)
103
+ end
104
+ def refute_have_content(*args) #:nodoc:
105
+ ActiveSupport::Deprecation.warn "refute_have_content is deprecated. Please use refute_content instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
106
+ refute_content(*args)
107
+ end
108
+ def refute_have_css(*args) #:nodoc:
109
+ ActiveSupport::Deprecation.warn "refute_have_css is deprecated. Please use refute_css instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
110
+ refute_css(*args)
111
+ end
112
+ def refute_have_field(*args) #:nodoc:
113
+ ActiveSupport::Deprecation.warn "refute_have_field is deprecated. Please use refute_field instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
114
+ refute_field(*args)
115
+ end
116
+ def refute_have_link(*args) #:nodoc:
117
+ ActiveSupport::Deprecation.warn "refute_have_link is deprecated. Please use refute_link instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
118
+ refute_link(*args)
119
+ end
120
+ def refute_have_select(*args) #:nodoc:
121
+ ActiveSupport::Deprecation.warn "refute_have_select is deprecated. Please use refute_select instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
122
+ refute_select(*args)
123
+ end
124
+ def refute_have_selector(*args) #:nodoc:
125
+ ActiveSupport::Deprecation.warn "refute_have_selector is deprecated. Please use refute_selector instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
126
+ refute_selector(*args)
127
+ end
128
+ def refute_have_table(*args) #:nodoc:
129
+ ActiveSupport::Deprecation.warn "refute_have_table is deprecated. Please use refute_table instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
130
+ refute_table(*args)
131
+ end
132
+ def refute_have_text(*args) #:nodoc:
133
+ ActiveSupport::Deprecation.warn "refute_have_text is deprecated. Please use refute_text instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
134
+ refute_text(*args)
135
+ end
136
+ def refute_have_unchecked_field(*args) #:nodoc:
137
+ ActiveSupport::Deprecation.warn "refute_have_unchecked_field is deprecated. Please use refute_unchecked_field instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
138
+ refute_unchecked_field(*args)
139
+ end
140
+ def refute_have_xpath(*args) #:nodoc:
141
+ ActiveSupport::Deprecation.warn "refute_have_xpath is deprecated. Please use refute_xpath instead. This method will be removed when minitest-rails-capybara reaches 1.0 release."
142
+ refute_xpath(*args)
143
+ end
144
+
145
+ ##
146
+ # Assertion that there is button
147
+ #
148
+ # see Capybara::Assertions#refute_button
149
+ # see Capybara::Assertions#assert_no_button
150
+ # see Capybara::expectations#must_have_button
151
+ # see Capybara::expectations#wont_have_button
152
+ # :method: assert_button
153
+
154
+ ##
155
+ # Assertion that there is no button
156
+ #
157
+ # see Capybara::Assertions#assert_button
158
+ # see Capybara::expectations#must_have_button
159
+ # see Capybara::expectations#wont_have_button
160
+ # :method: refute_button
161
+ # :alias: assert_no_button
162
+
163
+
164
+ ##
165
+ # Assertion that there is checked_field
166
+ #
167
+ # see Capybara::Assertions#refute_checked_field
168
+ # see Capybara::Assertions#assert_no_checked_field
169
+ # see Capybara::expectations#must_have_checked_field
170
+ # see Capybara::expectations#wont_have_checked_field
171
+ # :method: assert_checked_field
172
+
173
+ ##
174
+ # Assertion that there is no checked_field
175
+ #
176
+ # see Capybara::Assertions#assert_checked_field
177
+ # see Capybara::expectations#must_have_checked_field
178
+ # see Capybara::expectations#wont_have_checked_field
179
+ # :method: refute_checked_field
180
+ # :alias: assert_no_checked_field
181
+
182
+
183
+ ##
184
+ # Assertion that there is content
185
+ #
186
+ # see Capybara::Assertions#refute_content
187
+ # see Capybara::Assertions#assert_no_content
188
+ # see Capybara::expectations#must_have_content
189
+ # see Capybara::expectations#wont_have_content
190
+ # :method: assert_content
191
+
192
+ ##
193
+ # Assertion that there is no content
194
+ #
195
+ # see Capybara::Assertions#assert_content
196
+ # see Capybara::expectations#must_have_content
197
+ # see Capybara::expectations#wont_have_content
198
+ # :method: refute_content
199
+ # :alias: assert_no_content
200
+
201
+
202
+ ##
203
+ # Assertion that there is css
204
+ #
205
+ # see Capybara::Assertions#refute_css
206
+ # see Capybara::Assertions#assert_no_css
207
+ # see Capybara::expectations#must_have_css
208
+ # see Capybara::expectations#wont_have_css
209
+ # :method: assert_css
210
+
211
+ ##
212
+ # Assertion that there is no css
213
+ #
214
+ # see Capybara::Assertions#assert_css
215
+ # see Capybara::expectations#must_have_css
216
+ # see Capybara::expectations#wont_have_css
217
+ # :method: refute_css
218
+ # :alias: assert_no_css
219
+
220
+
221
+ ##
222
+ # Assertion that there is field
223
+ #
224
+ # see Capybara::Assertions#refute_field
225
+ # see Capybara::Assertions#assert_no_field
226
+ # see Capybara::expectations#must_have_field
227
+ # see Capybara::expectations#wont_have_field
228
+ # :method: assert_field
229
+
230
+ ##
231
+ # Assertion that there is no field
232
+ #
233
+ # see Capybara::Assertions#assert_field
234
+ # see Capybara::expectations#must_have_field
235
+ # see Capybara::expectations#wont_have_field
236
+ # :method: refute_field
237
+ # :alias: assert_no_field
238
+
239
+
240
+ ##
241
+ # Assertion that there is link
242
+ #
243
+ # see Capybara::Assertions#refute_link
244
+ # see Capybara::Assertions#assert_no_link
245
+ # see Capybara::expectations#must_have_link
246
+ # see Capybara::expectations#wont_have_link
247
+ # :method: assert_link
248
+
249
+ ##
250
+ # Assertion that there is no link
251
+ #
252
+ # see Capybara::Assertions#assert_link
253
+ # see Capybara::expectations#must_have_link
254
+ # see Capybara::expectations#wont_have_link
255
+ # :method: refute_link
256
+ # :alias: assert_no_link
257
+
258
+
259
+ ##
260
+ # Assertion that there is select
261
+ #
262
+ # see Capybara::Assertions#refute_select
263
+ # see Capybara::Assertions#assert_no_select
264
+ # see Capybara::expectations#must_have_select
265
+ # see Capybara::expectations#wont_have_select
266
+ # :method: assert_select
267
+
268
+ ##
269
+ # Assertion that there is no select
270
+ #
271
+ # see Capybara::Assertions#assert_select
272
+ # see Capybara::expectations#must_have_select
273
+ # see Capybara::expectations#wont_have_select
274
+ # :method: refute_select
275
+ # :alias: assert_no_select
276
+
277
+
278
+ ##
279
+ # Assertion that there is selector
280
+ #
281
+ # see Capybara::Assertions#refute_selector
282
+ # see Capybara::Assertions#assert_no_selector
283
+ # see Capybara::expectations#must_have_selector
284
+ # see Capybara::expectations#wont_have_selector
285
+ # :method: assert_selector
286
+
287
+ ##
288
+ # Assertion that there is no selector
289
+ #
290
+ # see Capybara::Assertions#assert_selector
291
+ # see Capybara::expectations#must_have_selector
292
+ # see Capybara::expectations#wont_have_selector
293
+ # :method: refute_selector
294
+ # :alias: assert_no_selector
295
+
296
+
297
+ ##
298
+ # Assertion that there is table
299
+ #
300
+ # see Capybara::Assertions#refute_table
301
+ # see Capybara::Assertions#assert_no_table
302
+ # see Capybara::expectations#must_have_table
303
+ # see Capybara::expectations#wont_have_table
304
+ # :method: assert_table
305
+
306
+ ##
307
+ # Assertion that there is no table
308
+ #
309
+ # see Capybara::Assertions#assert_table
310
+ # see Capybara::expectations#must_have_table
311
+ # see Capybara::expectations#wont_have_table
312
+ # :method: refute_table
313
+ # :alias: assert_no_table
314
+
315
+
316
+ ##
317
+ # Assertion that there is text
318
+ #
319
+ # see Capybara::Assertions#refute_text
320
+ # see Capybara::Assertions#assert_no_text
321
+ # see Capybara::expectations#must_have_text
322
+ # see Capybara::expectations#wont_have_text
323
+ # :method: assert_text
324
+
325
+ ##
326
+ # Assertion that there is no text
327
+ #
328
+ # see Capybara::Assertions#assert_text
329
+ # see Capybara::expectations#must_have_text
330
+ # see Capybara::expectations#wont_have_text
331
+ # :method: refute_text
332
+ # :alias: assert_no_text
333
+
334
+
335
+ ##
336
+ # Assertion that there is unchecked_field
337
+ #
338
+ # see Capybara::Assertions#refute_unchecked_field
339
+ # see Capybara::Assertions#assert_no_unchecked_field
340
+ # see Capybara::expectations#must_have_unchecked_field
341
+ # see Capybara::expectations#wont_have_unchecked_field
342
+ # :method: assert_unchecked_field
343
+
344
+ ##
345
+ # Assertion that there is no unchecked_field
346
+ #
347
+ # see Capybara::Assertions#assert_unchecked_field
348
+ # see Capybara::expectations#must_have_unchecked_field
349
+ # see Capybara::expectations#wont_have_unchecked_field
350
+ # :method: refute_unchecked_field
351
+ # :alias: assert_no_unchecked_field
352
+
353
+
354
+ ##
355
+ # Assertion that there is xpath
356
+ #
357
+ # see Capybara::Assertions#refute_xpath
358
+ # see Capybara::Assertions#assert_no_xpath
359
+ # see Capybara::expectations#must_have_xpath
360
+ # see Capybara::expectations#wont_have_xpath
361
+ # :method: assert_xpath
362
+
363
+ ##
364
+ # Assertion that there is no xpath
365
+ #
366
+ # see Capybara::Assertions#assert_xpath
367
+ # see Capybara::expectations#must_have_xpath
368
+ # see Capybara::expectations#wont_have_xpath
369
+ # :method: refute_xpath
370
+ # :alias: assert_no_xpath
371
+ end
372
+
373
+ module Expectations
374
+ ##
375
+ # Expectation that there is button
376
+ #
377
+ # see Capybara::Expectations#wont_have_button
378
+ # see Capybara::Assertions#assert_button
379
+ # see Capybara::Assertions#refute_button
380
+ # see Capybara::Assertions#assert_no_button
381
+ # :method: must_have_button
382
+
383
+ ##
384
+ # Expectation that there is no button
385
+ #
386
+ # see Capybara::Expectations#must_have_button
387
+ # see Capybara::Assertions#assert_button
388
+ # see Capybara::Assertions#refute_button
389
+ # see Capybara::Assertions#assert_no_button
390
+ # :method: wont_have_button
391
+
392
+
393
+ ##
394
+ # Expectation that there is checked_field
395
+ #
396
+ # see Capybara::Expectations#wont_have_checked_field
397
+ # see Capybara::Assertions#assert_checked_field
398
+ # see Capybara::Assertions#refute_checked_field
399
+ # see Capybara::Assertions#assert_no_checked_field
400
+ # :method: must_have_checked_field
401
+
402
+ ##
403
+ # Expectation that there is no checked_field
404
+ #
405
+ # see Capybara::Expectations#must_have_checked_field
406
+ # see Capybara::Assertions#assert_checked_field
407
+ # see Capybara::Assertions#refute_checked_field
408
+ # see Capybara::Assertions#assert_no_checked_field
409
+ # :method: wont_have_checked_field
410
+
411
+
412
+ ##
413
+ # Expectation that there is content
414
+ #
415
+ # see Capybara::Expectations#wont_have_content
416
+ # see Capybara::Assertions#assert_content
417
+ # see Capybara::Assertions#refute_content
418
+ # see Capybara::Assertions#assert_no_content
419
+ # :method: must_have_content
420
+
421
+ ##
422
+ # Expectation that there is no content
423
+ #
424
+ # see Capybara::Expectations#must_have_content
425
+ # see Capybara::Assertions#assert_content
426
+ # see Capybara::Assertions#refute_content
427
+ # see Capybara::Assertions#assert_no_content
428
+ # :method: wont_have_content
429
+
430
+
431
+ ##
432
+ # Expectation that there is css
433
+ #
434
+ # see Capybara::Expectations#wont_have_css
435
+ # see Capybara::Assertions#assert_css
436
+ # see Capybara::Assertions#refute_css
437
+ # see Capybara::Assertions#assert_no_css
438
+ # :method: must_have_css
439
+
440
+ ##
441
+ # Expectation that there is no css
442
+ #
443
+ # see Capybara::Expectations#must_have_css
444
+ # see Capybara::Assertions#assert_css
445
+ # see Capybara::Assertions#refute_css
446
+ # see Capybara::Assertions#assert_no_css
447
+ # :method: wont_have_css
448
+
449
+
450
+ ##
451
+ # Expectation that there is field
452
+ #
453
+ # see Capybara::Expectations#wont_have_field
454
+ # see Capybara::Assertions#assert_field
455
+ # see Capybara::Assertions#refute_field
456
+ # see Capybara::Assertions#assert_no_field
457
+ # :method: must_have_field
458
+
459
+ ##
460
+ # Expectation that there is no field
461
+ #
462
+ # see Capybara::Expectations#must_have_field
463
+ # see Capybara::Assertions#assert_field
464
+ # see Capybara::Assertions#refute_field
465
+ # see Capybara::Assertions#assert_no_field
466
+ # :method: wont_have_field
467
+
468
+
469
+ ##
470
+ # Expectation that there is link
471
+ #
472
+ # see Capybara::Expectations#wont_have_link
473
+ # see Capybara::Assertions#assert_link
474
+ # see Capybara::Assertions#refute_link
475
+ # see Capybara::Assertions#assert_no_link
476
+ # :method: must_have_link
477
+
478
+ ##
479
+ # Expectation that there is no link
480
+ #
481
+ # see Capybara::Expectations#must_have_link
482
+ # see Capybara::Assertions#assert_link
483
+ # see Capybara::Assertions#refute_link
484
+ # see Capybara::Assertions#assert_no_link
485
+ # :method: wont_have_link
486
+
487
+
488
+ ##
489
+ # Expectation that there is select
490
+ #
491
+ # see Capybara::Expectations#wont_have_select
492
+ # see Capybara::Assertions#assert_select
493
+ # see Capybara::Assertions#refute_select
494
+ # see Capybara::Assertions#assert_no_select
495
+ # :method: must_have_select
496
+
497
+ ##
498
+ # Expectation that there is no select
499
+ #
500
+ # see Capybara::Expectations#must_have_select
501
+ # see Capybara::Assertions#assert_select
502
+ # see Capybara::Assertions#refute_select
503
+ # see Capybara::Assertions#assert_no_select
504
+ # :method: wont_have_select
505
+
506
+
507
+ ##
508
+ # Expectation that there is selector
509
+ #
510
+ # see Capybara::Expectations#wont_have_selector
511
+ # see Capybara::Assertions#assert_selector
512
+ # see Capybara::Assertions#refute_selector
513
+ # see Capybara::Assertions#assert_no_selector
514
+ # :method: must_have_selector
515
+
516
+ ##
517
+ # Expectation that there is no selector
518
+ #
519
+ # see Capybara::Expectations#must_have_selector
520
+ # see Capybara::Assertions#assert_selector
521
+ # see Capybara::Assertions#refute_selector
522
+ # see Capybara::Assertions#assert_no_selector
523
+ # :method: wont_have_selector
524
+
525
+
526
+ ##
527
+ # Expectation that there is table
528
+ #
529
+ # see Capybara::Expectations#wont_have_table
530
+ # see Capybara::Assertions#assert_table
531
+ # see Capybara::Assertions#refute_table
532
+ # see Capybara::Assertions#assert_no_table
533
+ # :method: must_have_table
534
+
535
+ ##
536
+ # Expectation that there is no table
537
+ #
538
+ # see Capybara::Expectations#must_have_table
539
+ # see Capybara::Assertions#assert_table
540
+ # see Capybara::Assertions#refute_table
541
+ # see Capybara::Assertions#assert_no_table
542
+ # :method: wont_have_table
543
+
544
+
545
+ ##
546
+ # Expectation that there is text
547
+ #
548
+ # see Capybara::Expectations#wont_have_text
549
+ # see Capybara::Assertions#assert_text
550
+ # see Capybara::Assertions#refute_text
551
+ # see Capybara::Assertions#assert_no_text
552
+ # :method: must_have_text
553
+
554
+ ##
555
+ # Expectation that there is no text
556
+ #
557
+ # see Capybara::Expectations#must_have_text
558
+ # see Capybara::Assertions#assert_text
559
+ # see Capybara::Assertions#refute_text
560
+ # see Capybara::Assertions#assert_no_text
561
+ # :method: wont_have_text
562
+
563
+
564
+ ##
565
+ # Expectation that there is unchecked_field
566
+ #
567
+ # see Capybara::Expectations#wont_have_unchecked_field
568
+ # see Capybara::Assertions#assert_unchecked_field
569
+ # see Capybara::Assertions#refute_unchecked_field
570
+ # see Capybara::Assertions#assert_no_unchecked_field
571
+ # :method: must_have_unchecked_field
572
+
573
+ ##
574
+ # Expectation that there is no unchecked_field
575
+ #
576
+ # see Capybara::Expectations#must_have_unchecked_field
577
+ # see Capybara::Assertions#assert_unchecked_field
578
+ # see Capybara::Assertions#refute_unchecked_field
579
+ # see Capybara::Assertions#assert_no_unchecked_field
580
+ # :method: wont_have_unchecked_field
581
+
582
+
583
+ ##
584
+ # Expectation that there is xpath
585
+ #
586
+ # see Capybara::Expectations#wont_have_xpath
587
+ # see Capybara::Assertions#assert_xpath
588
+ # see Capybara::Assertions#refute_xpath
589
+ # see Capybara::Assertions#assert_no_xpath
590
+ # :method: must_have_xpath
591
+
592
+ ##
593
+ # Expectation that there is no xpath
594
+ #
595
+ # see Capybara::Expectations#must_have_xpath
596
+ # see Capybara::Assertions#assert_xpath
597
+ # see Capybara::Assertions#refute_xpath
598
+ # see Capybara::Assertions#assert_no_xpath
599
+ # :method: wont_have_xpath
600
+ end
601
+ end
@@ -2,50 +2,47 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "minitest-rails-capybara"
5
- s.version = "0.9.0.20130318234245"
5
+ s.version = "0.10.0.20130723183802"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Mike Moore"]
9
- s.date = "2013-03-19"
9
+ s.date = "2013-07-24"
10
10
  s.description = "Adds Capybara feature tests in MiniTest and Rails."
11
11
  s.email = ["mike@blowmage.com"]
12
12
  s.extra_rdoc_files = ["CHANGELOG.rdoc", "Manifest.txt", "README.rdoc"]
13
- s.files = [".autotest", ".gemtest", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "lib/generators/mini_test/feature/feature_generator.rb", "lib/generators/mini_test/feature/templates/feature_spec.rb", "lib/generators/mini_test/feature/templates/feature_test.rb", "lib/minitest-rails-capybara.rb", "lib/minitest/rails/capybara.rb", "minitest-rails-capybara.gemspec", "test/rails_helper.rb", "test/test_dsl.rb", "test/test_matchers.rb", "test/test_sanity.rb", "test/test_spec.rb"]
13
+ s.files = [".autotest", ".gemtest", "CHANGELOG.rdoc", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "lib/generators/mini_test/feature/feature_generator.rb", "lib/generators/mini_test/feature/templates/feature_spec.rb", "lib/generators/mini_test/feature/templates/feature_test.rb", "lib/minitest-rails-capybara.rb", "lib/minitest/rails/capybara.rb", "minitest-rails-capybara.gemspec", "test/rails_helper.rb", "test/test_assertions_expectation.rb", "test/test_dsl.rb", "test/test_sanity.rb", "test/test_spec.rb"]
14
14
  s.homepage = "http://blowmage.com/minitest-rails-capybara"
15
15
  s.rdoc_options = ["--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = "minitest-rails-capybara"
18
- s.rubygems_version = "1.8.23"
18
+ s.rubygems_version = "2.0.5"
19
19
  s.summary = "Capybara integration for MiniTest and Rails"
20
- s.test_files = ["test/test_dsl.rb", "test/test_matchers.rb", "test/test_sanity.rb", "test/test_spec.rb"]
20
+ s.test_files = ["test/test_assertions_expectation.rb", "test/test_dsl.rb", "test/test_sanity.rb", "test/test_spec.rb"]
21
21
 
22
22
  if s.respond_to? :specification_version then
23
- s.specification_version = 3
23
+ s.specification_version = 4
24
24
 
25
25
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
26
26
  s.add_runtime_dependency(%q<minitest-rails>, ["~> 0.9.1"])
27
27
  s.add_runtime_dependency(%q<capybara>, ["~> 2.0"])
28
- s.add_runtime_dependency(%q<minitest-capybara>, ["~> 0.1"])
29
- s.add_runtime_dependency(%q<minitest-matchers>, ["~> 1.2"])
30
- s.add_runtime_dependency(%q<minitest-metadata>, ["~> 0.3"])
31
- s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
32
- s.add_development_dependency(%q<hoe>, ["~> 3.5"])
28
+ s.add_runtime_dependency(%q<minitest-capybara>, ["~> 0.4"])
29
+ s.add_runtime_dependency(%q<minitest-metadata>, ["~> 0.4"])
30
+ s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
31
+ s.add_development_dependency(%q<hoe>, ["~> 3.6"])
33
32
  else
34
33
  s.add_dependency(%q<minitest-rails>, ["~> 0.9.1"])
35
34
  s.add_dependency(%q<capybara>, ["~> 2.0"])
36
- s.add_dependency(%q<minitest-capybara>, ["~> 0.1"])
37
- s.add_dependency(%q<minitest-matchers>, ["~> 1.2"])
38
- s.add_dependency(%q<minitest-metadata>, ["~> 0.3"])
39
- s.add_dependency(%q<rdoc>, ["~> 3.10"])
40
- s.add_dependency(%q<hoe>, ["~> 3.5"])
35
+ s.add_dependency(%q<minitest-capybara>, ["~> 0.4"])
36
+ s.add_dependency(%q<minitest-metadata>, ["~> 0.4"])
37
+ s.add_dependency(%q<rdoc>, ["~> 4.0"])
38
+ s.add_dependency(%q<hoe>, ["~> 3.6"])
41
39
  end
42
40
  else
43
41
  s.add_dependency(%q<minitest-rails>, ["~> 0.9.1"])
44
42
  s.add_dependency(%q<capybara>, ["~> 2.0"])
45
- s.add_dependency(%q<minitest-capybara>, ["~> 0.1"])
46
- s.add_dependency(%q<minitest-matchers>, ["~> 1.2"])
47
- s.add_dependency(%q<minitest-metadata>, ["~> 0.3"])
48
- s.add_dependency(%q<rdoc>, ["~> 3.10"])
49
- s.add_dependency(%q<hoe>, ["~> 3.5"])
43
+ s.add_dependency(%q<minitest-capybara>, ["~> 0.4"])
44
+ s.add_dependency(%q<minitest-metadata>, ["~> 0.4"])
45
+ s.add_dependency(%q<rdoc>, ["~> 4.0"])
46
+ s.add_dependency(%q<hoe>, ["~> 3.6"])
50
47
  end
51
48
  end
data/test/rails_helper.rb CHANGED
@@ -22,6 +22,7 @@ end
22
22
 
23
23
  Rails.application = TestApp
24
24
 
25
+ require "rails/test_help"
25
26
  require "minitest/rails/capybara"
26
27
 
27
28
  Capybara.session_name = nil
@@ -0,0 +1,80 @@
1
+ require "rails_helper"
2
+
3
+ describe "Capybara Assertions and Expectations Feature Test" do
4
+
5
+ describe "have_content" do
6
+ it "has page with content" do
7
+ visit root_path
8
+ assert_content page, "Hello World"
9
+ refute_content page, "Goobye All!"
10
+ page.must_have_content "Hello World"
11
+ page.wont_have_content "Goobye All!"
12
+ end
13
+ it "gives a warning on old assertions" do
14
+ visit root_path
15
+ assert_have_content page, "Hello World"
16
+ refute_have_content page, "Goobye All!"
17
+ end
18
+ end
19
+
20
+ describe "have_selector" do
21
+ it "has page with heading" do
22
+ visit root_path
23
+ assert_selector page, "h1"
24
+ refute_selector page, "h3"
25
+ page.must_have_selector "h1"
26
+ page.wont_have_selector "h3"
27
+ end
28
+ end
29
+
30
+ describe "have_link" do
31
+ it "has a link to home" do
32
+ visit root_path
33
+ assert_link page, "home"
34
+ refute_link page, "away"
35
+ page.must_have_link "home"
36
+ page.wont_have_link "away"
37
+ end
38
+ end
39
+
40
+ describe "have_field" do
41
+ it "has a button to submit" do
42
+ visit root_path
43
+ assert_field page, "Email Address"
44
+ refute_field page, "Bank Account"
45
+ page.must_have_field "Email Address"
46
+ page.wont_have_field "Bank Account"
47
+ end
48
+ end
49
+
50
+ describe "have_button" do
51
+ it "has a button to login" do
52
+ visit root_path
53
+ assert_button page, "random button"
54
+ refute_button page, "missing button"
55
+ page.must_have_button "random button"
56
+ page.wont_have_button "missing button"
57
+ end
58
+ end
59
+
60
+ describe "have_checked_field" do
61
+ it "has a button to submit" do
62
+ visit root_path
63
+ assert_checked_field page, "going"
64
+ refute_checked_field page, "avoid"
65
+ page.must_have_checked_field "going"
66
+ page.wont_have_checked_field "avoid"
67
+ end
68
+ end
69
+
70
+ describe "have_unchecked_field" do
71
+ it "has a button to submit" do
72
+ visit root_path
73
+ assert_unchecked_field page, "avoid"
74
+ refute_unchecked_field page, "going"
75
+ page.must_have_unchecked_field "avoid"
76
+ page.wont_have_unchecked_field "going"
77
+ end
78
+ end
79
+
80
+ end
metadata CHANGED
@@ -1,128 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-rails-capybara
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.9.0
4
+ version: 0.10.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mike Moore
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-19 00:00:00.000000000 Z
11
+ date: 2013-07-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- type: :runtime
16
14
  name: minitest-rails
17
- prerelease: false
18
- version_requirements: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - ~>
21
- - !ruby/object:Gem::Version
22
- version: 0.9.1
23
- none: false
24
15
  requirement: !ruby/object:Gem::Requirement
25
16
  requirements:
26
17
  - - ~>
27
18
  - !ruby/object:Gem::Version
28
19
  version: 0.9.1
29
- none: false
30
- - !ruby/object:Gem::Dependency
31
20
  type: :runtime
32
- name: capybara
33
21
  prerelease: false
34
22
  version_requirements: !ruby/object:Gem::Requirement
35
23
  requirements:
36
24
  - - ~>
37
25
  - !ruby/object:Gem::Version
38
- version: '2.0'
39
- none: false
26
+ version: 0.9.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: capybara
40
29
  requirement: !ruby/object:Gem::Requirement
41
30
  requirements:
42
31
  - - ~>
43
32
  - !ruby/object:Gem::Version
44
33
  version: '2.0'
45
- none: false
46
- - !ruby/object:Gem::Dependency
47
34
  type: :runtime
48
- name: minitest-capybara
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - ~>
53
39
  - !ruby/object:Gem::Version
54
- version: '0.1'
55
- none: false
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest-capybara
56
43
  requirement: !ruby/object:Gem::Requirement
57
44
  requirements:
58
45
  - - ~>
59
46
  - !ruby/object:Gem::Version
60
- version: '0.1'
61
- none: false
62
- - !ruby/object:Gem::Dependency
47
+ version: '0.4'
63
48
  type: :runtime
64
- name: minitest-matchers
65
49
  prerelease: false
66
50
  version_requirements: !ruby/object:Gem::Requirement
67
51
  requirements:
68
52
  - - ~>
69
53
  - !ruby/object:Gem::Version
70
- version: '1.2'
71
- none: false
54
+ version: '0.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest-metadata
72
57
  requirement: !ruby/object:Gem::Requirement
73
58
  requirements:
74
59
  - - ~>
75
60
  - !ruby/object:Gem::Version
76
- version: '1.2'
77
- none: false
78
- - !ruby/object:Gem::Dependency
61
+ version: '0.4'
79
62
  type: :runtime
80
- name: minitest-metadata
81
63
  prerelease: false
82
64
  version_requirements: !ruby/object:Gem::Requirement
83
65
  requirements:
84
66
  - - ~>
85
67
  - !ruby/object:Gem::Version
86
- version: '0.3'
87
- none: false
68
+ version: '0.4'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
88
71
  requirement: !ruby/object:Gem::Requirement
89
72
  requirements:
90
73
  - - ~>
91
74
  - !ruby/object:Gem::Version
92
- version: '0.3'
93
- none: false
94
- - !ruby/object:Gem::Dependency
75
+ version: '4.0'
95
76
  type: :development
96
- name: rdoc
97
77
  prerelease: false
98
78
  version_requirements: !ruby/object:Gem::Requirement
99
79
  requirements:
100
80
  - - ~>
101
81
  - !ruby/object:Gem::Version
102
- version: '3.10'
103
- none: false
82
+ version: '4.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: hoe
104
85
  requirement: !ruby/object:Gem::Requirement
105
86
  requirements:
106
87
  - - ~>
107
88
  - !ruby/object:Gem::Version
108
- version: '3.10'
109
- none: false
110
- - !ruby/object:Gem::Dependency
89
+ version: '3.6'
111
90
  type: :development
112
- name: hoe
113
91
  prerelease: false
114
92
  version_requirements: !ruby/object:Gem::Requirement
115
93
  requirements:
116
94
  - - ~>
117
95
  - !ruby/object:Gem::Version
118
- version: '3.5'
119
- none: false
120
- requirement: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ~>
123
- - !ruby/object:Gem::Version
124
- version: '3.5'
125
- none: false
96
+ version: '3.6'
126
97
  description: Adds Capybara feature tests in MiniTest and Rails.
127
98
  email:
128
99
  - mike@blowmage.com
@@ -147,12 +118,13 @@ files:
147
118
  - lib/minitest/rails/capybara.rb
148
119
  - minitest-rails-capybara.gemspec
149
120
  - test/rails_helper.rb
121
+ - test/test_assertions_expectation.rb
150
122
  - test/test_dsl.rb
151
- - test/test_matchers.rb
152
123
  - test/test_sanity.rb
153
124
  - test/test_spec.rb
154
125
  homepage: http://blowmage.com/minitest-rails-capybara
155
126
  licenses: []
127
+ metadata: {}
156
128
  post_install_message:
157
129
  rdoc_options:
158
130
  - --main
@@ -161,24 +133,22 @@ require_paths:
161
133
  - lib
162
134
  required_ruby_version: !ruby/object:Gem::Requirement
163
135
  requirements:
164
- - - ! '>='
136
+ - - '>='
165
137
  - !ruby/object:Gem::Version
166
138
  version: '0'
167
- none: false
168
139
  required_rubygems_version: !ruby/object:Gem::Requirement
169
140
  requirements:
170
- - - ! '>='
141
+ - - '>='
171
142
  - !ruby/object:Gem::Version
172
143
  version: '0'
173
- none: false
174
144
  requirements: []
175
145
  rubyforge_project: minitest-rails-capybara
176
- rubygems_version: 1.8.23
146
+ rubygems_version: 2.0.5
177
147
  signing_key:
178
- specification_version: 3
148
+ specification_version: 4
179
149
  summary: Capybara integration for MiniTest and Rails
180
150
  test_files:
151
+ - test/test_assertions_expectation.rb
181
152
  - test/test_dsl.rb
182
- - test/test_matchers.rb
183
153
  - test/test_sanity.rb
184
154
  - test/test_spec.rb
@@ -1,145 +0,0 @@
1
- require "rails_helper"
2
-
3
- describe "Capybara Matchers Feature Test" do
4
-
5
- describe "have_content" do
6
- it "has page with content" do
7
- visit root_path
8
- assert_have_content page, "Hello World"
9
- refute_have_content page, "Goobye All!"
10
- page.must_have_content "Hello World"
11
- page.wont_have_content "Goobye All!"
12
- end
13
-
14
- describe "with subject" do
15
- before { visit(root_path) }
16
- subject { page }
17
-
18
- it { must have_content("Hello World") }
19
- it { wont have_content("Goobye All!") }
20
- must { have_content("Hello World") }
21
- wont { have_content("Goobye All!") }
22
- end
23
- end
24
-
25
- describe "have_selector" do
26
- it "has page with heading" do
27
- visit root_path
28
- assert_have_selector page, "h1"
29
- refute_have_selector page, "h3"
30
- page.must_have_selector "h1"
31
- page.wont_have_selector "h3"
32
- end
33
-
34
- describe "with subject" do
35
- before { visit(root_path) }
36
- subject { page }
37
-
38
- it { must have_selector("h1") }
39
- it { wont have_selector("h3") }
40
- must { have_selector("h1") }
41
- wont { have_selector("h3") }
42
- end
43
- end
44
-
45
- describe "have_link" do
46
- it "has a link to home" do
47
- visit root_path
48
- assert_have_link page, "home"
49
- refute_have_link page, "away"
50
- page.must_have_link "home"
51
- page.wont_have_link "away"
52
- end
53
-
54
- describe "with subject" do
55
- before { visit(root_path) }
56
- subject { page }
57
-
58
- it { must have_link("home") }
59
- it { wont have_link("away") }
60
- must { have_link("home") }
61
- wont { have_link("away") }
62
- end
63
- end
64
-
65
- describe "have_field" do
66
- it "has a button to submit" do
67
- visit root_path
68
- assert_have_field page, "Email Address"
69
- refute_have_field page, "Bank Account"
70
- page.must_have_field "Email Address"
71
- page.wont_have_field "Bank Account"
72
- end
73
-
74
- describe "with subject" do
75
- before { visit(root_path) }
76
- subject { page }
77
-
78
- it { must have_field("Email Address") }
79
- it { wont have_field("Bank Account") }
80
- must { have_field("Email Address") }
81
- wont { have_field("Bank Account") }
82
- end
83
- end
84
-
85
- describe "have_button" do
86
- it "has a button to login" do
87
- visit root_path
88
- assert_have_button page, "random button"
89
- refute_have_button page, "missing button"
90
- page.must_have_button "random button"
91
- page.wont_have_button "missing button"
92
- end
93
-
94
- describe "with subject" do
95
- before { visit(root_path) }
96
- subject { page }
97
-
98
- it { must have_button("random button") }
99
- it { wont have_button("missing button") }
100
- must { have_button("random button") }
101
- wont { have_button("missing button") }
102
- end
103
- end
104
-
105
- describe "have_checked_field" do
106
- it "has a button to submit" do
107
- visit root_path
108
- assert_have_checked_field page, "going"
109
- refute_have_checked_field page, "avoid"
110
- page.must_have_checked_field "going"
111
- page.wont_have_checked_field "avoid"
112
- end
113
-
114
- describe "with subject" do
115
- before { visit(root_path) }
116
- subject { page }
117
-
118
- it { must have_checked_field("going") }
119
- it { wont have_checked_field("avoid") }
120
- must { have_checked_field("going") }
121
- wont { have_checked_field("avoid") }
122
- end
123
- end
124
-
125
- describe "have_unchecked_field" do
126
- it "has a button to submit" do
127
- visit root_path
128
- assert_have_unchecked_field page, "avoid"
129
- refute_have_unchecked_field page, "going"
130
- page.must_have_unchecked_field "avoid"
131
- page.wont_have_unchecked_field "going"
132
- end
133
-
134
- describe "with subject" do
135
- before { visit(root_path) }
136
- subject { page }
137
-
138
- it { must have_unchecked_field("avoid") }
139
- it { wont have_unchecked_field("going") }
140
- must { have_unchecked_field("avoid") }
141
- wont { have_unchecked_field("going") }
142
- end
143
- end
144
-
145
- end