rspec-rails 2.11.0 → 2.11.4

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/.yardopts CHANGED
@@ -6,3 +6,4 @@
6
6
  -
7
7
  Changelog.md
8
8
  License.txt
9
+ Capybara.md
@@ -0,0 +1,81 @@
1
+ rspec-rails supports integration with Capbyara out of the box by adding
2
+ its Capybara::DSL (visit/page) and Capybara::RSpecMatchers to the
3
+ examples in the applicable directories, which differ slightly between
4
+ Capybara 1.x and Capybara >= 2.x.
5
+
6
+ Note that you need to require "capybara/rspec" for this integration to work.
7
+
8
+ ## Capybara::DSL
9
+
10
+ Adds the `visit` and `page` methods, which work together to simulate a
11
+ `get` and provide access to the result (via `page`).
12
+
13
+ ## Capybara::RSpecMatchers
14
+
15
+ Exposes matchers used to specify expected HTML content (e.g. `have_selector`).
16
+
17
+ ## Capybara 1.x
18
+
19
+ Capybara::DSL is added to examples in:
20
+
21
+ * spec/requests # included by Capybara
22
+ * spec/controllers
23
+
24
+ Capybara::RSpecMatchers is added to examples in:
25
+
26
+ * spec/requests # included by Capybara
27
+ * spec/controllers
28
+ * spec/views
29
+ * spec/helpers
30
+ * spec/mailers
31
+
32
+ ## Capybara 2.0
33
+
34
+ To use Capybara 2.0, you need rspec-rails-2.11.1 or greater.
35
+
36
+ Capybara::DSL is added to examples in:
37
+
38
+ * spec/features
39
+
40
+ Capybara::RSpecMatchers is added to examples in:
41
+
42
+ * spec/features
43
+ * spec/controllers
44
+ * spec/views
45
+ * spec/helpers
46
+ * spec/mailers
47
+
48
+ ## Upgrading to Capybara-2.0
49
+
50
+ Many users have been confused by the co-existence of the the
51
+ Capybara::DSL (visit/page) alongside the rack-test DSL
52
+ (get|post|put|delete|head/response.body) in examples in spec/requests
53
+ and spec/controllers. As of rspec-2.11.1 and capybara-2.0.0.beta2, these
54
+ are separated as follows:
55
+
56
+ * Capybara::DSL is included `spec/features`
57
+ * rack-test DSL is included in `spec/requests` and `spec/controllers`
58
+
59
+ Capybara::RSpecMatchers is added to examples in:
60
+
61
+ * spec/features
62
+ * spec/controllers
63
+ * spec/views
64
+ * spec/helpers
65
+ * spec/mailers
66
+
67
+ If you're upgrading to Capybara-2.0 and you used visit/page in
68
+ spec/requests you'll want to move those examples to spec/features and
69
+ they should just work.
70
+
71
+ If you want to leave those examples in spec/requests, you can include
72
+ Capybara::DSL in those examples yourself as follows, but this is
73
+ absolutely not recommended as you will be overriding the intended
74
+ behavior and accepting the risks associated with doing so:
75
+
76
+ # not recommended!
77
+ RSpec.configure do |c|
78
+ c.include Capybara::DSL, :example_group => {
79
+ :file_path => "spec/requests"
80
+ }
81
+ end
@@ -1,3 +1,17 @@
1
+ ### 2.11.4 / 2012-10-14
2
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.11.0...v2.11.4)
3
+
4
+ Capybara-2.0 integration support:
5
+
6
+ * include RailsExampleGroup in spec/features (necessary when there is no AR)
7
+ * include Capybara::DSL and Capybara::RSpecMatchers in spec/features
8
+
9
+ See [https://github.com/jnicklas/capybara/pull/809](https://github.com/jnicklas/capybara/pull/809)
10
+ and [http://rubydoc.info/gems/rspec-rails/file/CAPYBARA.md](http://rubydoc.info/gems/rspec-rails/file/CAPYBARA.md)
11
+ for background.
12
+
13
+ 2.11.1, .2, .3 were yanked due to errant documentation.
14
+
1
15
  ### 2.11.0 / 2012-07-07
2
16
  [full changelog](http://github.com/rspec/rspec-rails/compare/v2.10.1...v2.11.0)
3
17
 
data/README.md CHANGED
@@ -64,6 +64,10 @@ gem "webrat"
64
64
  gem "capybara"
65
65
  ```
66
66
 
67
+ See [http://rubydoc.info/gems/rspec-rails/file/Capybara.md](http://rubydoc.info/gems/rspec-rails/file/Capybara.md)
68
+ for more info on Capybara integration.
69
+
70
+
67
71
  ## Living on edge
68
72
 
69
73
  Bundler makes it a snap to use the latest code for any gem your app depends on. For
@@ -3,7 +3,6 @@ module RSpec
3
3
  if defined?(ActiveRecord::TestFixtures)
4
4
  module FixtureSupport
5
5
  extend ActiveSupport::Concern
6
-
7
6
  include RSpec::Rails::SetupAndTeardownAdapter
8
7
  include RSpec::Rails::TestUnitAssertionAdapter
9
8
  include ActiveRecord::TestFixtures
@@ -37,4 +36,3 @@ module RSpec
37
36
  end
38
37
  end
39
38
  end
40
-
@@ -8,20 +8,30 @@ begin
8
8
  rescue LoadError
9
9
  end
10
10
 
11
- RSpec.configure do |c|
12
- if defined?(Capybara::RSpecMatchers)
13
- c.include Capybara::RSpecMatchers, :type => :view
14
- c.include Capybara::RSpecMatchers, :type => :helper
15
- c.include Capybara::RSpecMatchers, :type => :mailer
16
- c.include Capybara::RSpecMatchers, :type => :controller
17
- end
11
+ if defined?(Capybara)
12
+ RSpec.configure do |c|
13
+ if defined?(Capybara::DSL)
14
+ c.include Capybara::DSL, :type => :controller
15
+ c.include Capybara::DSL, :example_group => {
16
+ :file_path => c.escaped_path(%w[spec features])
17
+ }
18
+ end
18
19
 
19
- if defined?(Capybara::DSL)
20
- c.include Capybara::DSL, :type => :controller
21
- end
20
+ if defined?(Capybara::RSpecMatchers)
21
+ c.include Capybara::RSpecMatchers, :type => :view
22
+ c.include Capybara::RSpecMatchers, :type => :helper
23
+ c.include Capybara::RSpecMatchers, :type => :mailer
24
+ c.include Capybara::RSpecMatchers, :type => :controller
25
+ c.include Capybara::RSpecMatchers, :example_group => {
26
+ :file_path => c.escaped_path(%w[spec features])
27
+ }
28
+ end
22
29
 
23
- unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
24
- if defined?(Capybara)
30
+ if defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
31
+ c.include RSpec::Rails::RailsExampleGroup, :example_group => {
32
+ :file_path => c.escaped_path(%w[spec features])
33
+ }
34
+ else
25
35
  c.include Capybara, :type => :request
26
36
  c.include Capybara, :type => :controller
27
37
  end
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Rails
3
3
  module Version
4
- STRING = '2.11.0'
4
+ STRING = '2.11.4'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.0
4
+ version: 2.11.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-07 00:00:00.000000000 Z
12
+ date: 2012-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -224,6 +224,7 @@ files:
224
224
  - README.md
225
225
  - License.txt
226
226
  - Changelog.md
227
+ - Capybara.md
227
228
  - .yardopts
228
229
  - .document
229
230
  - features/Autotest.md
@@ -318,7 +319,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
318
319
  version: '0'
319
320
  segments:
320
321
  - 0
321
- hash: -673310072700950015
322
+ hash: 3042437687647811829
322
323
  required_rubygems_version: !ruby/object:Gem::Requirement
323
324
  none: false
324
325
  requirements:
@@ -327,13 +328,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
328
  version: '0'
328
329
  segments:
329
330
  - 0
330
- hash: -673310072700950015
331
+ hash: 3042437687647811829
331
332
  requirements: []
332
333
  rubyforge_project: rspec
333
334
  rubygems_version: 1.8.24
334
335
  signing_key:
335
336
  specification_version: 3
336
- summary: rspec-rails-2.11.0
337
+ summary: rspec-rails-2.11.4
337
338
  test_files:
338
339
  - features/Autotest.md
339
340
  - features/Generators.md