rspec-rails 3.0.0.beta2 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +2 -1
  4. data/Capybara.md +1 -3
  5. data/Changelog.md +126 -58
  6. data/README.md +31 -4
  7. data/lib/generators/rspec/controller/templates/controller_spec.rb +1 -1
  8. data/lib/generators/rspec/controller/templates/view_spec.rb +1 -1
  9. data/lib/generators/rspec/feature/templates/feature_spec.rb +1 -1
  10. data/lib/generators/rspec/helper/templates/helper_spec.rb +1 -1
  11. data/lib/generators/rspec/install/templates/spec/spec_helper.rb.tt +21 -1
  12. data/lib/generators/rspec/integration/templates/request_spec.rb +1 -1
  13. data/lib/generators/rspec/mailer/templates/mailer_spec.rb +1 -1
  14. data/lib/generators/rspec/model/templates/model_spec.rb +1 -1
  15. data/lib/generators/rspec/observer/templates/observer_spec.rb +1 -1
  16. data/lib/generators/rspec/scaffold/templates/controller_spec.rb +11 -3
  17. data/lib/generators/rspec/scaffold/templates/edit_spec.rb +4 -3
  18. data/lib/generators/rspec/scaffold/templates/index_spec.rb +2 -2
  19. data/lib/generators/rspec/scaffold/templates/new_spec.rb +5 -4
  20. data/lib/generators/rspec/scaffold/templates/routing_spec.rb +1 -1
  21. data/lib/generators/rspec/scaffold/templates/show_spec.rb +2 -2
  22. data/lib/generators/rspec/view/templates/view_spec.rb +1 -1
  23. data/lib/rspec/rails.rb +1 -8
  24. data/lib/rspec/rails/configuration.rb +72 -0
  25. data/lib/rspec/rails/example.rb +0 -64
  26. data/lib/rspec/rails/example/controller_example_group.rb +16 -12
  27. data/lib/rspec/rails/example/feature_example_group.rb +0 -2
  28. data/lib/rspec/rails/example/helper_example_group.rb +0 -2
  29. data/lib/rspec/rails/example/mailer_example_group.rb +0 -1
  30. data/lib/rspec/rails/example/model_example_group.rb +0 -4
  31. data/lib/rspec/rails/example/request_example_group.rb +0 -2
  32. data/lib/rspec/rails/example/routing_example_group.rb +0 -2
  33. data/lib/rspec/rails/example/view_example_group.rb +1 -2
  34. data/lib/rspec/rails/extensions.rb +0 -1
  35. data/lib/rspec/rails/fixture_support.rb +0 -8
  36. data/lib/rspec/rails/matchers.rb +1 -0
  37. data/lib/rspec/rails/matchers/have_http_status.rb +355 -0
  38. data/lib/rspec/rails/matchers/routing_matchers.rb +1 -1
  39. data/lib/rspec/rails/tasks/rspec.rake +12 -5
  40. data/lib/rspec/rails/version.rb +1 -1
  41. data/lib/rspec/rails/view_rendering.rb +6 -34
  42. metadata +42 -316
  43. metadata.gz.sig +0 -0
  44. data/features/Generators.md +0 -25
  45. data/features/GettingStarted.md +0 -84
  46. data/features/README.md +0 -48
  47. data/features/RailsVersions.md +0 -4
  48. data/features/Transactions.md +0 -84
  49. data/features/Upgrade.md +0 -121
  50. data/features/controller_specs/Cookies.md +0 -57
  51. data/features/controller_specs/README.md +0 -45
  52. data/features/controller_specs/anonymous_controller.feature +0 -436
  53. data/features/controller_specs/bypass_rescue.feature +0 -75
  54. data/features/controller_specs/controller_spec.feature +0 -58
  55. data/features/controller_specs/engine_routes.feature +0 -51
  56. data/features/controller_specs/isolation_from_views.feature +0 -87
  57. data/features/controller_specs/render_views.feature +0 -114
  58. data/features/directory_structure.feature +0 -71
  59. data/features/feature_specs/feature_spec.feature +0 -35
  60. data/features/helper_specs/helper_spec.feature +0 -122
  61. data/features/mailer_specs/url_helpers.feature +0 -38
  62. data/features/matchers/README.md +0 -18
  63. data/features/matchers/new_record_matcher.feature +0 -41
  64. data/features/matchers/redirect_to_matcher.feature +0 -40
  65. data/features/matchers/relation_match_array.feature +0 -27
  66. data/features/matchers/render_template_matcher.feature +0 -49
  67. data/features/mocks/mock_model.feature +0 -147
  68. data/features/mocks/stub_model.feature +0 -58
  69. data/features/model_specs/README.md +0 -21
  70. data/features/model_specs/errors_on.feature +0 -51
  71. data/features/model_specs/records.feature +0 -27
  72. data/features/model_specs/transactional_examples.feature +0 -109
  73. data/features/request_specs/request_spec.feature +0 -49
  74. data/features/routing_specs/README.md +0 -16
  75. data/features/routing_specs/be_routable_matcher.feature +0 -80
  76. data/features/routing_specs/engine_routes.feature +0 -38
  77. data/features/routing_specs/named_routes.feature +0 -18
  78. data/features/routing_specs/route_to_matcher.feature +0 -90
  79. data/features/step_definitions/additional_cli_steps.rb +0 -4
  80. data/features/step_definitions/model_steps.rb +0 -3
  81. data/features/support/capybara.rb +0 -7
  82. data/features/support/env.rb +0 -53
  83. data/features/support/rails_versions.rb +0 -4
  84. data/features/support/rubinius.rb +0 -6
  85. data/features/view_specs/inferred_controller_path.feature +0 -45
  86. data/features/view_specs/stub_template.feature +0 -51
  87. data/features/view_specs/view_spec.feature +0 -206
  88. data/lib/rspec/rails/extensions/active_record/base.rb +0 -58
  89. data/lib/rspec/rails/mocks.rb +0 -272
  90. data/lib/rspec/rails/vendor/webrat.rb +0 -33
  91. data/spec/generators/rspec/controller/controller_generator_spec.rb +0 -97
  92. data/spec/generators/rspec/feature/feature_generator_spec.rb +0 -43
  93. data/spec/generators/rspec/helper/helper_generator_spec.rb +0 -30
  94. data/spec/generators/rspec/install/install_generator_spec.rb +0 -30
  95. data/spec/generators/rspec/integration/integration_generator_spec.rb +0 -32
  96. data/spec/generators/rspec/mailer/mailer_generator_spec.rb +0 -48
  97. data/spec/generators/rspec/model/model_generator_spec.rb +0 -52
  98. data/spec/generators/rspec/observer/observer_generator_spec.rb +0 -21
  99. data/spec/generators/rspec/scaffold/scaffold_generator_spec.rb +0 -138
  100. data/spec/generators/rspec/view/view_generator_spec.rb +0 -41
  101. data/spec/rspec/rails/assertion_adapter_spec.rb +0 -28
  102. data/spec/rspec/rails/assertion_delegator_spec.rb +0 -43
  103. data/spec/rspec/rails/configuration_spec.rb +0 -26
  104. data/spec/rspec/rails/deprecations_spec.rb +0 -18
  105. data/spec/rspec/rails/example/controller_example_group_spec.rb +0 -159
  106. data/spec/rspec/rails/example/feature_example_group_spec.rb +0 -56
  107. data/spec/rspec/rails/example/helper_example_group_spec.rb +0 -66
  108. data/spec/rspec/rails/example/mailer_example_group_spec.rb +0 -21
  109. data/spec/rspec/rails/example/model_example_group_spec.rb +0 -15
  110. data/spec/rspec/rails/example/request_example_group_spec.rb +0 -17
  111. data/spec/rspec/rails/example/routing_example_group_spec.rb +0 -32
  112. data/spec/rspec/rails/example/view_example_group_spec.rb +0 -235
  113. data/spec/rspec/rails/extensions/active_model/errors_on_spec.rb +0 -23
  114. data/spec/rspec/rails/extensions/active_record/base_spec.rb +0 -42
  115. data/spec/rspec/rails/fixture_support_spec.rb +0 -17
  116. data/spec/rspec/rails/matchers/be_a_new_spec.rb +0 -142
  117. data/spec/rspec/rails/matchers/be_new_record_spec.rb +0 -33
  118. data/spec/rspec/rails/matchers/be_routable_spec.rb +0 -41
  119. data/spec/rspec/rails/matchers/be_valid_spec.rb +0 -73
  120. data/spec/rspec/rails/matchers/has_spec.rb +0 -29
  121. data/spec/rspec/rails/matchers/have_rendered_spec.rb +0 -93
  122. data/spec/rspec/rails/matchers/redirect_to_spec.rb +0 -81
  123. data/spec/rspec/rails/matchers/relation_match_array_spec.rb +0 -31
  124. data/spec/rspec/rails/matchers/route_to_spec.rb +0 -151
  125. data/spec/rspec/rails/minitest_lifecycle_adapter_spec.rb +0 -31
  126. data/spec/rspec/rails/mocks/mock_model_spec.rb +0 -400
  127. data/spec/rspec/rails/mocks/stub_model_spec.rb +0 -154
  128. data/spec/rspec/rails/setup_and_teardown_adapter_spec.rb +0 -32
  129. data/spec/rspec/rails/view_rendering_spec.rb +0 -111
  130. data/spec/spec_helper.rb +0 -33
  131. data/spec/support/ar_classes.rb +0 -42
  132. data/spec/support/helpers.rb +0 -34
  133. data/spec/support/matchers.rb +0 -9
  134. data/spec/support/null_object.rb +0 -6
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7a33b97b88c1b74c6ff81f48380f86281847892a
4
+ data.tar.gz: 7621acffba98290f0761567e9818300b5b7686a4
5
+ SHA512:
6
+ metadata.gz: a3488a19517a4b3ee09cf23bc7da4f2bd14292c4a3f15252aebd621bd8b42a94beecc83212ac95188d1c4b0acaf13c5303b9b917cad0a4aed4fbd768cad92d35
7
+ data.tar.gz: 97ae5bb4223cd14bcc6357e735db57c08cd5efd2e3e4bf24ee18cae8b712b14fee57bf9cb09bb1b7f98fa31883c9f91d8db3dd34f5d046dd1951b33ca2dc0404
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- ��$�]���{�[Y��O_�����= .M���Q�hȊ��C `�ŭBOLuD ���$��cz*��]�-�Ǵ�s�4��s��A:���n��s3݉
1
+ E6��~>�~�'= c(���<��&��<۱տ�2)a�h3D6�At�¸���P`�$���R��"�VUkȨ��/���L��\=j�2Re�%s�[��ĩ���+��+k;{a��xp��,�}��3��[|k��|?m��Ɏ�_�foQ̜��_NJ���G��*j�Pɥ?
2
+ #˰0]���;&����{�h?�
data/Capybara.md CHANGED
@@ -73,7 +73,5 @@ behavior and accepting the risks associated with doing so:
73
73
 
74
74
  # not recommended!
75
75
  RSpec.configure do |c|
76
- c.include Capybara::DSL, :example_group => {
77
- :file_path => "spec/requests"
78
- }
76
+ c.include Capybara::DSL, :file_path => "spec/requests"
79
77
  end
data/Changelog.md CHANGED
@@ -1,20 +1,41 @@
1
- ### 3.0.0.beta2 / 2014-02-17
2
- [full changelog](http://github.com/rspec/rspec-rails/compare/v3.0.0.beta1...v3.0.0.beta2)
3
-
4
- Bug fixes
1
+ ### 3.0.0.rc1 / 2014-05-18
2
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.0.0.beta2...v3.0.0.rc1)
5
3
 
6
- * Use `__send__` rather than `send` to prevent naming collisions (Bradley Schaefer)
7
- * Supports Rails 4.1. (Andy Lindeman)
8
- * Routes are drawn correctly for anonymous controllers with abstract
9
- parents. (Billy Chan)
10
- * Loads ActiveSupport properly to support changes in Rails 4.1. (Andy Lindeman)
11
- * Anonymous controllers inherit from `ActionController::Base` if `ApplicationController`
12
- is not present. (Jon Rowe)
13
- * Require `rspec/collection_matchers` when `rspec/rails` is required. (Yuji Nakayama)
4
+ Breaking Changes for 3.0.0:
14
5
 
15
- Enhancements
6
+ * Extracts the `mock_model` and `stub_model` methods to the
7
+ `rspec-activemodel-mocks` gem. (Thomas Holmes)
8
+ * Spec types are no longer inferred by location, they instead need to be
9
+ explicitly tagged. The old behaviour is enabled by
10
+ `config.infer_spec_type_from_file_location!`, which is still supplied
11
+ in the default generated `spec_helper.rb`. (Xavier Shay, Myron Marston)
12
+ * `controller` macro in controller specs no longer mutates
13
+ `:described_class` metadata. It still overrides the subject and sets
14
+ the controller, though. (Myron Marston)
15
+ * Stop depending on or requiring `rspec-collection_matchers`. Users who
16
+ want those matchers should add the gem to their Gemfile and require it
17
+ themselves. (Myron Marston)
18
+ * Removes runtime dependency on `ActiveModel`. (Rodrigo Rosenfeld Rosas)
19
+
20
+ Enhancements:
21
+
22
+ * Supports Rails 4.x reference attribute ids in generated scaffold for view
23
+ specs. (Giovanni Cappellotto)
24
+ * Add `have_http_status` matcher. (Aaron Kromer)
25
+ * Add spec type metadata to generator templates. (Aaron Kromer)
26
+
27
+ Bug Fixes:
28
+
29
+ * Fix an inconsistency in the generated scaffold specs for a controller. (Andy Waite)
30
+ * Ensure `config.before(:all, :type => <type>)` hooks run before groups
31
+ of the given type, even when the type is inferred by the file
32
+ location. (Jon Rowe, Myron Marston)
33
+ * Switch to parsing params with `Rack::Utils::parse_nested_query` to match Rails.
34
+ (Tim Watson)
35
+ * Fix incorrect namespacing of anonymous controller routes. (Aaron Kromer)
16
36
 
17
- * Improve be_valid matcher for non-ActiveModel::Errors implementations (Ben Hamill)
37
+ ### 3.0.0.beta2 / 2014-02-17
38
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.0.0.beta1...v3.0.0.beta2)
18
39
 
19
40
  Breaking Changes for 3.0.0:
20
41
 
@@ -26,56 +47,103 @@ Breaking Changes for 3.0.0:
26
47
  enabled by default. (Thomas Holmes)
27
48
  * Capybara 2.2.0 or above is required for feature specs. (Andy Lindeman)
28
49
 
29
- ### 3.0.0.beta1 / 2013-11-07
30
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta1...v3.0.0.beta1)
50
+ Enhancements:
31
51
 
32
- Breaking Changes for 3.0.0:
33
-
34
- * Extracts `autotest` and `autotest-rails` support to `rspec-autotest` gem.
35
- (Andy Lindeman)
52
+ * Improve `be_valid` matcher for non-ActiveModel::Errors implementations (Ben Hamill)
36
53
 
37
- ### 2.99.0.beta2 / 2014-02-17
38
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta1...v2.99.0.beta2)
39
-
40
- Bug fixes
54
+ Bug Fixes:
41
55
 
42
56
  * Use `__send__` rather than `send` to prevent naming collisions (Bradley Schaefer)
43
57
  * Supports Rails 4.1. (Andy Lindeman)
58
+ * Routes are drawn correctly for anonymous controllers with abstract
59
+ parents. (Billy Chan)
44
60
  * Loads ActiveSupport properly to support changes in Rails 4.1. (Andy Lindeman)
45
61
  * Anonymous controllers inherit from `ActionController::Base` if `ApplicationController`
46
62
  is not present. (Jon Rowe)
63
+ * Require `rspec/collection_matchers` when `rspec/rails` is required. (Yuji Nakayama)
64
+
65
+ ### 3.0.0.beta1 / 2013-11-07
66
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.rc1...v3.0.0.beta1)
67
+
68
+ Breaking Changes for 3.0.0:
69
+
70
+ * Extracts `autotest` and `autotest-rails` support to `rspec-autotest` gem.
71
+ (Andy Lindeman)
72
+
73
+ ### 2.99.0.rc1 / 2014-05-18
74
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta2...v2.99.0.rc1)
47
75
 
48
76
  Deprecations
49
77
 
78
+ * Deprecates `stub_model` and `mock_model` in favor of the
79
+ `rspec-activemodel-mocks` gem. (Thomas Holmes)
80
+ * Issue a deprecation to instruct users to configure
81
+ `config.infer_spec_type_from_file_location!` during the
82
+ upgrade process since spec type inference is opt-in in 3.0.
83
+ (Jon Rowe)
84
+ * Issue a deprecation when `described_class` is accessed in a controller
85
+ example group that has used the `controller { }` macro to generate an
86
+ anonymous controller class, since in 2.x, `described_class` would
87
+ return that generated class but in 3.0 it will continue returning the
88
+ class passed to `describe`. (Myron Marston)
89
+
90
+ ### 2.99.0.beta2 / 2014-02-17
91
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta1...v2.99.0.beta2)
92
+
93
+ Deprecations:
94
+
50
95
  * Deprecates the `--webrat` option to the scaffold and request spec generator (Andy Lindeman)
51
96
  * Deprecates the use of `Capybara::DSL` (e.g., `visit`) in controller specs.
52
97
  It is more appropriate to use capybara in feature specs (`spec/features`)
53
98
  instead. (Andy Lindeman)
54
99
 
100
+ Bug Fixes:
101
+
102
+ * Use `__send__` rather than `send` to prevent naming collisions (Bradley Schaefer)
103
+ * Supports Rails 4.1. (Andy Lindeman)
104
+ * Loads ActiveSupport properly to support changes in Rails 4.1. (Andy Lindeman)
105
+ * Anonymous controllers inherit from `ActionController::Base` if `ApplicationController`
106
+ is not present. (Jon Rowe)
107
+
55
108
  ### 2.99.0.beta1 / 2013-11-07
56
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0...v2.99.0.beta1)
109
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0...v2.99.0.beta1)
57
110
 
58
- Deprecations
111
+ Deprecations:
59
112
 
60
113
  * Deprecates autotest integration in favor of the `rspec-autotest` gem. (Andy
61
114
  Lindeman)
62
115
 
63
- Enhancements
116
+ Enhancements:
64
117
 
65
118
  * Supports Rails 4.1 and Minitest 5. (Patrick Van Stee)
66
119
 
67
- Bug fixes
120
+ Bug Fixes:
121
+
122
+ * Fixes "warning: instance variable @orig\_routes not initialized" raised by
123
+ controller specs when `--warnings` are enabled. (Andy Lindeman)
124
+ * Where possible, check against the version of ActiveRecord, rather than
125
+ Rails. It is possible to use some of rspec-rails without all of Rails.
126
+ (Darryl Pogue)
127
+ * Explicitly depends on `activemodel`. This allows libraries that do not bring
128
+ in all of `rails` to use `rspec-rails`. (John Firebaugh)
129
+
130
+ ### 2.14.1 / 2013-12-29
131
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0...v2.14.1)
132
+
133
+ Bug Fixes:
68
134
 
69
135
  * Fixes "warning: instance variable @orig\_routes not initialized" raised by
70
136
  controller specs when `--warnings` are enabled. (Andy Lindeman)
71
137
  * Where possible, check against the version of ActiveRecord, rather than
72
138
  Rails. It is possible to use some of rspec-rails without all of Rails.
73
139
  (Darryl Pogue)
140
+ * Supports Rails 4.1 and Minitest 5. (Patrick Van Stee, Andy Lindeman)
74
141
  * Explicitly depends on `activemodel`. This allows libraries that do not bring
75
142
  in all of `rails` to use `rspec-rails`. (John Firebaugh)
143
+ * Use `__send__` rather than `send` to prevent naming collisions (Bradley Schaefer)
76
144
 
77
145
  ### 2.14.0 / 2013-07-06
78
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0.rc1...v2.14.0)
146
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0.rc1...v2.14.0)
79
147
 
80
148
  Bug fixes
81
149
 
@@ -87,7 +155,7 @@ Bug fixes
87
155
  Rails 4. (Andy Lindeman)
88
156
 
89
157
  ### 2.14.0.rc1 / 2013-05-27
90
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.13.2...v2.14.0.rc1)
158
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.13.2...v2.14.0.rc1)
91
159
 
92
160
  Enhancements
93
161
 
@@ -100,7 +168,7 @@ Bug fixes
100
168
  spec/ directory. (Benjamin Fleischer)
101
169
 
102
170
  ### 2.13.2 / 2013-05-18
103
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.13.1...v2.13.2)
171
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.13.1...v2.13.2)
104
172
 
105
173
  Bug fixes
106
174
 
@@ -115,7 +183,7 @@ Enhancements
115
183
  * Document how the spec/support directory works. (Sam Phippen)
116
184
 
117
185
  ### 2.13.1 / 2013-04-27
118
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.13.0...v2.13.1)
186
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.13.0...v2.13.1)
119
187
 
120
188
  Bug fixes
121
189
 
@@ -129,7 +197,7 @@ Bug fixes
129
197
  * Fix spacing in the install generator template (Taiki ONO)
130
198
 
131
199
  ### 2.13.0 / 2013-02-23
132
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.12.2...v2.13.0)
200
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.12.2...v2.13.0)
133
201
 
134
202
  Enhancements
135
203
 
@@ -144,7 +212,7 @@ Enhancements
144
212
  (Rudolf Schmidt)
145
213
 
146
214
  ### 2.12.2 / 2013-01-12
147
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.12.1...v2.12.2)
215
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.12.1...v2.12.2)
148
216
 
149
217
  Bug fixes
150
218
 
@@ -156,7 +224,7 @@ Bug fixes
156
224
  Lindeman)
157
225
 
158
226
  ### 2.12.1 / 2013-01-07
159
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.12.0...v2.12.1)
227
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.12.0...v2.12.1)
160
228
 
161
229
  Bug fixes
162
230
 
@@ -171,7 +239,7 @@ Bug fixes
171
239
  and generation of URLs from other contexts. (Andy Lindeman)
172
240
 
173
241
  ### 2.12.0 / 2012-11-12
174
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.11.4...v2.12.0)
242
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.11.4...v2.12.0)
175
243
 
176
244
  Enhancements
177
245
 
@@ -192,7 +260,7 @@ Bug fixes
192
260
  * Failures message for `be_new_record` are more useful (Andy Lindeman)
193
261
 
194
262
  ### 2.11.4 / 2012-10-14
195
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.11.0...v2.11.4)
263
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.11.0...v2.11.4)
196
264
 
197
265
  Capybara-2.0 integration support:
198
266
 
@@ -206,7 +274,7 @@ for background.
206
274
  2.11.1, .2, .3 were yanked due to errant documentation.
207
275
 
208
276
  ### 2.11.0 / 2012-07-07
209
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.10.1...v2.11.0)
277
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.10.1...v2.11.0)
210
278
 
211
279
  Enhancements
212
280
 
@@ -225,7 +293,7 @@ Bug fixes
225
293
  loads (Andy Lindeman)
226
294
 
227
295
  ### 2.10.1 / 2012-05-03
228
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.10.0...v2.10.1)
296
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.10.0...v2.10.1)
229
297
 
230
298
  Bug fixes
231
299
 
@@ -235,7 +303,7 @@ Bug fixes
235
303
  Rails already does this (Jack Dempsey)
236
304
 
237
305
  ### 2.10.0 / 2012-05-03
238
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.9.0...v2.10.0)
306
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.9.0...v2.10.0)
239
307
 
240
308
  Bug fixes
241
309
 
@@ -250,7 +318,7 @@ Bug fixes
250
318
  Strother)
251
319
 
252
320
  ### 2.9.0 / 2012-03-17
253
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.8.1...v2.9.0)
321
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.8.1...v2.9.0)
254
322
 
255
323
  Enhancements
256
324
 
@@ -265,7 +333,7 @@ Bug fixes
265
333
 
266
334
  ### 2.8.1 / 2012-01-04
267
335
 
268
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0...v2.8.1)
336
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0...v2.8.1)
269
337
 
270
338
  NOTE: there was a change in rails-3.2.0.rc2 which broke compatibility with
271
339
  stub_model in rspec-rails. This release fixes that issue, but it means that
@@ -278,7 +346,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
278
346
 
279
347
  ### 2.8.0 / 2012-01-04
280
348
 
281
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0.rc2...v2.8.0)
349
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0.rc2...v2.8.0)
282
350
 
283
351
  * Enhancements
284
352
  * Eliminate deprecation warnings in generated view specs in Rails 3.2
@@ -288,7 +356,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
288
356
 
289
357
  ### 2.8.0.rc2 / 2011-12-19
290
358
 
291
- [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.8.0.rc1...v2.8.0.rc2)
359
+ [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.8.0.rc1...v2.8.0.rc2)
292
360
 
293
361
  * Enhancements
294
362
  * Add session hash to generated controller specs (Thiago Almeida)
@@ -300,7 +368,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
300
368
 
301
369
  ### 2.8.0.rc1 / 2011-11-06
302
370
 
303
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.7.0...v2.8.0.rc1)
371
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.7.0...v2.8.0.rc1)
304
372
 
305
373
  * Enhancements
306
374
  * Removed unnecessary "config.mock_with :rspec" from spec_helper.rb (Paul
@@ -316,7 +384,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
316
384
 
317
385
  ### 2.7.0 / 2011-10-16
318
386
 
319
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.6.1...v2.7.0)
387
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.6.1...v2.7.0)
320
388
 
321
389
  * Enhancements
322
390
  * `ActiveRecord::Relation` can use the `=~` matcher (Andy Lindeman)
@@ -341,7 +409,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
341
409
 
342
410
  ### 2.6.1 / 2011-05-25
343
411
 
344
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.6.0...v2.6.1)
412
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.6.0...v2.6.1)
345
413
 
346
414
  This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
347
415
 
@@ -352,7 +420,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
352
420
 
353
421
  ### 2.6.0 / 2011-05-12
354
422
 
355
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.5.0...v2.6.0)
423
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.5.0...v2.6.0)
356
424
 
357
425
  * Enhancements
358
426
  * rails 3 shortcuts for routing specs (Joe Fiorini)
@@ -376,7 +444,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
376
444
 
377
445
  ### 2.5.0 / 2011-02-05
378
446
 
379
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.1...v2.5.0)
447
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.4.1...v2.5.0)
380
448
 
381
449
  * Enhancements
382
450
  * use index_helper instead of table_name when generating specs (Reza
@@ -391,7 +459,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
391
459
 
392
460
  ### 2.4.1 / 2011-01-03
393
461
 
394
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.0...v2.4.1)
462
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.4.0...v2.4.1)
395
463
 
396
464
  * Bug fixes
397
465
  * fixed bug caused by including some Rails modules before RSpec's
@@ -399,7 +467,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
399
467
 
400
468
  ### 2.4.0 / 2011-01-02
401
469
 
402
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.1...v2.4.0)
470
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.3.1...v2.4.0)
403
471
 
404
472
  * Enhancements
405
473
  * include ApplicationHelper in helper object in helper specs
@@ -419,7 +487,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
419
487
 
420
488
  ### 2.3.1 / 2010-12-16
421
489
 
422
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.0...v2.3.1)
490
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.3.0...v2.3.1)
423
491
 
424
492
  * Bug fixes
425
493
  * respond_to? correctly handles 2 args
@@ -427,7 +495,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
427
495
 
428
496
  ### 2.3.0 / 2010-12-12
429
497
 
430
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.1...v2.3.0)
498
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.2.1...v2.3.0)
431
499
 
432
500
  * Changes
433
501
  * Generator no longer generates autotest/autodiscover.rb, as it is no longer
@@ -435,7 +503,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
435
503
 
436
504
  ### 2.2.1 / 2010-12-01
437
505
 
438
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.0...v2.2.1)
506
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.2.0...v2.2.1)
439
507
 
440
508
  * Bug fixes
441
509
  * Depend on railties, activesupport, and actionpack instead of rails (Piotr
@@ -447,7 +515,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
447
515
 
448
516
  ### 2.2.0 / 2010-11-28
449
517
 
450
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.1.0...v2.2.0)
518
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.1.0...v2.2.0)
451
519
 
452
520
  * Enhancements
453
521
  * Added stub_template in view specs
@@ -462,7 +530,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
462
530
 
463
531
  ### 2.1.0 / 2010-11-07
464
532
 
465
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.1...v2.1.0)
533
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.0.1...v2.1.0)
466
534
 
467
535
  * Enhancements
468
536
  * Move errors_on to ActiveModel to support other AM-compliant ORMs
@@ -473,7 +541,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
473
541
 
474
542
  ### 2.0.1 / 2010-10-15
475
543
 
476
- [full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0...v2.0.1)
544
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0...v2.0.1)
477
545
 
478
546
  * Enhancements
479
547
  * Add option to not generate request spec (--skip-request-specs)
@@ -486,7 +554,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
486
554
 
487
555
  ### 2.0.0 / 2010-10-10
488
556
 
489
- [full changelog](https://github.com/rspec/rspec-rails/compare/ea6bdef...v2.0.0)
557
+ [Full Changelog](https://github.com/rspec/rspec-rails/compare/ea6bdef...v2.0.0)
490
558
 
491
559
  * Enhancements
492
560
  * ControllerExampleGroup uses controller as the implicit subject by default (Paul Rosania)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # rspec-rails [![Build Status](https://secure.travis-ci.org/rspec/rspec-rails.png?branch=master)](http://travis-ci.org/rspec/rspec-rails) [![Code Climate](https://codeclimate.com/github/rspec/rspec-rails.png)](https://codeclimate.com/github/rspec/rspec-rails)
1
+ # rspec-rails [![Build Status](https://secure.travis-ci.org/rspec/rspec-rails.png?branch=master)](http://travis-ci.org/rspec/rspec-rails) [![Code Climate](https://codeclimate.com/github/rspec/rspec-rails.png)](https://codeclimate.com/github/rspec/rspec-rails) [![Inline docs](http://inch-pages.github.io/github/rspec/rspec-rails.png)](http://inch-pages.github.io/github/rspec/rspec-rails)
2
2
 
3
3
  **rspec-rails** is a testing framework for Rails 3.x and 4.x.
4
4
 
@@ -120,10 +120,12 @@ For more information, see [cucumber scenarios for controller
120
120
  specs](https://www.relishapp.com/rspec/rspec-rails/docs/controller-specs).
121
121
 
122
122
  **Note:** To encourage more isolated testing, views are not rendered by default
123
- in controller specs. If you wish to assert against the contents of the rendered
124
- view in a controller spec, enable
123
+ in controller specs. If you are verifying discrete view logic, use a
124
+ [view spec](#view-specs). If you are verifying the behaviour of a controller and
125
+ view together, consider a [request spec](#request-specs). You can use
125
126
  [render\_views](https://www.relishapp.com/rspec/rspec-rails/docs/controller-specs/render-views)
126
- or use a higher-level [request spec](#request-specs).
127
+ if you must verify the rendered view contents within a controller spec, but this is
128
+ not recommended.
127
129
 
128
130
  ## <a id="request-spec"></a>Request Specs
129
131
 
@@ -415,6 +417,31 @@ to be used with `not_to` to specify routes that should not be routable.
415
417
  expect(:get => "/widgets/1/edit").not_to be_routable
416
418
  ```
417
419
 
420
+ ## `have_http_status`
421
+
422
+ * Passes if `response` has a matching HTTP status code
423
+ * The following symbolic status codes are allowed:
424
+ - `Rack::Utils::SYMBOL_TO_STATUS_CODE`
425
+ - One of the defined `ActionDispatch::TestResponse` aliases:
426
+ - `:error`
427
+ - `:missing`
428
+ - `:redirect`
429
+ - `:success`
430
+ * Available in controller, feature, and request specs.
431
+
432
+ In controller and request specs, apply to the `response` object:
433
+
434
+ ```ruby
435
+ expect(response).to have_http_status(201)
436
+ expect(response).not_to have_http_status(:created)
437
+ ```
438
+
439
+ In feature specs, apply to the `page` object:
440
+
441
+ ```ruby
442
+ expect(page).to have_http_status(:success)
443
+ ```
444
+
418
445
  # `rake` tasks
419
446
 
420
447
  `rspec-rails` defines rake tasks to run the entire test suite (`rake spec`)