rspec-rails 2.99.0 → 3.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.sig +2 -0
  3. data.tar.gz.sig +0 -0
  4. data/Changelog.md +40 -68
  5. data/License.txt +1 -0
  6. data/README.md +6 -4
  7. data/features/Generators.md +24 -0
  8. data/features/GettingStarted.md +84 -0
  9. data/features/README.md +56 -0
  10. data/features/RailsVersions.md +4 -0
  11. data/features/Transactions.md +84 -0
  12. data/features/Upgrade.md +121 -0
  13. data/features/controller_specs/Cookies.md +57 -0
  14. data/features/controller_specs/README.md +45 -0
  15. data/features/controller_specs/anonymous_controller.feature +378 -0
  16. data/features/controller_specs/bypass_rescue.feature +75 -0
  17. data/features/controller_specs/controller_spec.feature +58 -0
  18. data/features/controller_specs/engine_routes.feature +51 -0
  19. data/features/controller_specs/isolation_from_views.feature +87 -0
  20. data/features/controller_specs/render_views.feature +114 -0
  21. data/features/directory_structure.feature +71 -0
  22. data/features/feature_specs/feature_spec.feature +35 -0
  23. data/features/helper_specs/helper_spec.feature +122 -0
  24. data/features/mailer_specs/url_helpers.feature +38 -0
  25. data/features/matchers/README.md +18 -0
  26. data/features/matchers/new_record_matcher.feature +41 -0
  27. data/features/matchers/redirect_to_matcher.feature +40 -0
  28. data/features/matchers/relation_match_array.feature +27 -0
  29. data/features/matchers/render_template_matcher.feature +49 -0
  30. data/features/mocks/mock_model.feature +147 -0
  31. data/features/mocks/stub_model.feature +58 -0
  32. data/features/model_specs/README.md +21 -0
  33. data/features/model_specs/errors_on.feature +51 -0
  34. data/features/model_specs/records.feature +27 -0
  35. data/features/model_specs/transactional_examples.feature +109 -0
  36. data/features/request_specs/request_spec.feature +49 -0
  37. data/features/routing_specs/README.md +16 -0
  38. data/features/routing_specs/be_routable_matcher.feature +80 -0
  39. data/features/routing_specs/engine_routes.feature +38 -0
  40. data/features/routing_specs/named_routes.feature +18 -0
  41. data/features/routing_specs/route_to_matcher.feature +90 -0
  42. data/features/step_definitions/additional_cli_steps.rb +4 -0
  43. data/features/step_definitions/model_steps.rb +3 -0
  44. data/features/support/capybara.rb +7 -0
  45. data/features/support/env.rb +53 -0
  46. data/features/support/rails_versions.rb +4 -0
  47. data/features/support/rubinius.rb +6 -0
  48. data/features/view_specs/inferred_controller_path.feature +45 -0
  49. data/features/view_specs/stub_template.feature +51 -0
  50. data/features/view_specs/view_spec.feature +206 -0
  51. data/lib/generators/rspec/controller/templates/controller_spec.rb +1 -1
  52. data/lib/generators/rspec/install/templates/spec/spec_helper.rb.tt +2 -21
  53. data/lib/generators/rspec/integration/integration_generator.rb +2 -3
  54. data/lib/generators/rspec/integration/templates/request_spec.rb +1 -1
  55. data/lib/generators/rspec/mailer/templates/mailer_spec.rb +4 -4
  56. data/lib/generators/rspec/scaffold/scaffold_generator.rb +2 -3
  57. data/lib/generators/rspec/scaffold/templates/controller_spec.rb +16 -16
  58. data/lib/generators/rspec/scaffold/templates/edit_spec.rb +2 -2
  59. data/lib/generators/rspec/scaffold/templates/index_spec.rb +1 -1
  60. data/lib/generators/rspec/scaffold/templates/new_spec.rb +2 -2
  61. data/lib/generators/rspec/scaffold/templates/routing_spec.rb +7 -7
  62. data/lib/generators/rspec/scaffold/templates/show_spec.rb +2 -2
  63. data/lib/rspec/rails.rb +0 -5
  64. data/lib/rspec/rails/adapters.rb +5 -12
  65. data/lib/rspec/rails/example.rb +55 -24
  66. data/lib/rspec/rails/example/controller_example_group.rb +7 -31
  67. data/lib/rspec/rails/example/view_example_group.rb +0 -3
  68. data/lib/rspec/rails/matchers.rb +1 -2
  69. data/lib/rspec/rails/matchers/be_a_new.rb +1 -1
  70. data/lib/rspec/rails/matchers/be_new_record.rb +1 -1
  71. data/lib/rspec/rails/matchers/be_valid.rb +1 -1
  72. data/lib/rspec/rails/matchers/have_rendered.rb +1 -1
  73. data/lib/rspec/rails/matchers/redirect_to.rb +1 -1
  74. data/lib/rspec/rails/matchers/relation_match_array.rb +1 -1
  75. data/lib/rspec/rails/matchers/routing_matchers.rb +6 -10
  76. data/lib/rspec/rails/mocks.rb +5 -41
  77. data/lib/rspec/rails/tasks/rspec.rake +5 -12
  78. data/lib/rspec/rails/vendor/capybara.rb +4 -35
  79. data/lib/rspec/rails/version.rb +1 -1
  80. data/spec/generators/rspec/controller/controller_generator_spec.rb +97 -0
  81. data/spec/generators/rspec/helper/helper_generator_spec.rb +30 -0
  82. data/spec/generators/rspec/install/install_generator_spec.rb +30 -0
  83. data/spec/generators/rspec/integration/integration_generator_spec.rb +44 -0
  84. data/spec/generators/rspec/mailer/mailer_generator_spec.rb +48 -0
  85. data/spec/generators/rspec/model/model_generator_spec.rb +52 -0
  86. data/spec/generators/rspec/observer/observer_generator_spec.rb +21 -0
  87. data/spec/generators/rspec/scaffold/scaffold_generator_spec.rb +138 -0
  88. data/spec/generators/rspec/view/view_generator_spec.rb +41 -0
  89. data/spec/rspec/rails/assertion_adapter_spec.rb +28 -0
  90. data/spec/rspec/rails/assertion_delegator_spec.rb +43 -0
  91. data/spec/rspec/rails/configuration_spec.rb +26 -0
  92. data/spec/rspec/rails/deprecations_spec.rb +18 -0
  93. data/spec/rspec/rails/example/controller_example_group_spec.rb +100 -0
  94. data/spec/rspec/rails/example/feature_example_group_spec.rb +56 -0
  95. data/spec/rspec/rails/example/helper_example_group_spec.rb +66 -0
  96. data/spec/rspec/rails/example/mailer_example_group_spec.rb +21 -0
  97. data/spec/rspec/rails/example/model_example_group_spec.rb +15 -0
  98. data/spec/rspec/rails/example/request_example_group_spec.rb +17 -0
  99. data/spec/rspec/rails/example/routing_example_group_spec.rb +32 -0
  100. data/spec/rspec/rails/example/view_example_group_spec.rb +220 -0
  101. data/spec/rspec/rails/extensions/active_model/errors_on_spec.rb +23 -0
  102. data/spec/rspec/rails/extensions/active_record/base_spec.rb +42 -0
  103. data/spec/rspec/rails/fixture_support_spec.rb +17 -0
  104. data/spec/rspec/rails/matchers/be_a_new_spec.rb +142 -0
  105. data/spec/rspec/rails/matchers/be_new_record_spec.rb +33 -0
  106. data/spec/rspec/rails/matchers/be_routable_spec.rb +41 -0
  107. data/spec/rspec/rails/matchers/be_valid_spec.rb +44 -0
  108. data/spec/rspec/rails/matchers/has_spec.rb +29 -0
  109. data/spec/rspec/rails/matchers/have_rendered_spec.rb +93 -0
  110. data/spec/rspec/rails/matchers/redirect_to_spec.rb +80 -0
  111. data/spec/rspec/rails/matchers/relation_match_array_spec.rb +31 -0
  112. data/spec/rspec/rails/matchers/route_to_spec.rb +151 -0
  113. data/spec/rspec/rails/minitest_lifecycle_adapter_spec.rb +22 -0
  114. data/spec/rspec/rails/mocks/mock_model_spec.rb +378 -0
  115. data/spec/rspec/rails/mocks/stub_model_spec.rb +154 -0
  116. data/spec/rspec/rails/setup_and_teardown_adapter_spec.rb +32 -0
  117. data/spec/rspec/rails/view_rendering_spec.rb +111 -0
  118. data/spec/spec_helper.rb +35 -0
  119. data/spec/support/ar_classes.rb +42 -0
  120. data/spec/support/helpers.rb +20 -0
  121. data/spec/support/matchers.rb +9 -0
  122. data/spec/support/null_object.rb +6 -0
  123. metadata +229 -42
  124. metadata.gz.sig +0 -0
  125. data/lib/autotest/rails_rspec2.rb +0 -91
  126. data/lib/rspec/rails/infer_type_configuration.rb +0 -26
  127. data/lib/rspec/rails/matchers/have_extension.rb +0 -36
  128. data/lib/rspec/rails/module_inclusion.rb +0 -19
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWRkMzI4YTZjMTIzZTAwMjgxY2YwY2YyYmZkNDU2MzJmOTRlYTk5ZQ==
4
+ ZWZkMThkMWZmOGVlYjgwMDc5N2JiNjJlMGIxMDUxOWU2ZjU0MDJmYw==
5
5
  data.tar.gz: !binary |-
6
- MjRmYTc3YzgwZTQ2ZWU2NDc0NDU3ODk3MWUwYzgyNjY4MTE0OWIyNQ==
6
+ NWY3YmE1ZDI3YWUxYmNjYmVlZjM2ODM5ZTM2NjkzYjdiN2Q4ZDAzYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Yjk4Y2EyNGU1ODBlODRhNGYwZTE3NzIzMzFiYjkxMWQ1YjBiM2I3ZDc2YzMx
10
- YmE0NTkwYTJjYmJmYzI2NTQ1Y2YzYThjNzFhZDczMDBkODgwMmRlYzQyZTI5
11
- MjYzYjRjZmRjYzQ5OTg0ZWI0YTNlYmRjNmNkNWVhZmUzZWJlMjE=
9
+ MGFlODM2N2E0ZDFmMDRmMGJhNjkyOWE3ZDgwZmQ2ZjM5MjFlYjk0NDk3Mzhk
10
+ MzNhZTY3NDk0ZDBhNTVhYTkyOGI2MGMyOWJjY2IyMjdmMDM3MDljMTAwZWYy
11
+ Y2U3M2ZmMDRlMzJhNTg1MjFiOWViZTQ0YzgyNGRlZjc3YWNiNzI=
12
12
  data.tar.gz: !binary |-
13
- ZDBkZmE3NjIwNTFhOWUyYzRmODAyZGYyNmI3YTJkODUzZTNjMzQxZTQ5NDU5
14
- YjViMWU2MTQzZGVlMzliNmUyMTA3OTA5MDc0NWFkYTFjM2I2Njg0YjJhZjUy
15
- NTRlMGY4OThlNjI5NWIzYjM3ZDZmNzRhZTNhOTViY2Y0YzBkZWI=
13
+ YmM1YTAzYzY1NmVjNGYxMzM2MmJlNDJkYzU0NjRjNTE5ZGI4NGFjMTc3NTk4
14
+ ZWMwZTZkZjhlZjBiMGYwYTI0YjFhOWZkNTYyOWZjZjBmZGI3OWZhYTE3NTNh
15
+ OTFjODUxMDkwMWNmN2RjNjM4MzNjOTE3OWM5MjEzNGY5NzFmZTQ=
@@ -0,0 +1,2 @@
1
+ n� %)��Q�*�0Q�U��͞�ay�7���-�~�1��w(�J\�z�� -�|;g�����Z���Ռ«7
2
+ OD\���WK'�@�7s뗘�)�D�k*Y���ΘF�[O����0�/~�l>�V��:[NՏ.|��-+�3 �}&�g�3GvX��^Ŝ�lix���0��[�z��;![���%i�6��价�I��vb�V��_֩8�g\� ��I�ɦ�H�+��W�Cq�0�E#w��b<�4�o��eJ��$�{
Binary file
@@ -1,45 +1,13 @@
1
- ### 2.99.0 / 2014-06-01
2
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.rc1...v2.99.0)
1
+ ### 3.0.0.beta1 / 2013-11-07
2
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta1...v3.0.0.beta1)
3
3
 
4
- No changes. Just taking it out of pre-release.
4
+ Breaking Changes for 3.0.0:
5
5
 
6
- ### 2.99.0.rc1 / 2014-05-18
7
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta2...v2.99.0.rc1)
8
-
9
- Deprecations
10
-
11
- * Deprecates `stub_model` and `mock_model` in favor of the
12
- `rspec-activemodel-mocks` gem. (Thomas Holmes)
13
- * Issue a deprecation to instruct users to configure
14
- `config.infer_spec_type_from_file_location!` during the
15
- upgrade process since spec type inference is opt-in in 3.0.
16
- (Jon Rowe)
17
- * Issue a deprecation when `described_class` is accessed in a controller
18
- example group that has used the `controller { }` macro to generate an
19
- anonymous controller class, since in 2.x, `described_class` would
20
- return that generated class but in 3.0 it will continue returning the
21
- class passed to `describe`. (Myron Marston)
22
-
23
- ### 2.99.0.beta2 / 2014-02-17
24
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.99.0.beta1...v2.99.0.beta2)
25
-
26
- Bug fixes
27
-
28
- * Use `__send__` rather than `send` to prevent naming collisions (Bradley Schaefer)
29
- * Supports Rails 4.1. (Andy Lindeman)
30
- * Loads ActiveSupport properly to support changes in Rails 4.1. (Andy Lindeman)
31
- * Anonymous controllers inherit from `ActionController::Base` if `ApplicationController`
32
- is not present. (Jon Rowe)
33
-
34
- Deprecations
35
-
36
- * Deprecates the `--webrat` option to the scaffold and request spec generator (Andy Lindeman)
37
- * Deprecates the use of `Capybara::DSL` (e.g., `visit`) in controller specs.
38
- It is more appropriate to use capybara in feature specs (`spec/features`)
39
- instead. (Andy Lindeman)
6
+ * Extracts `autotest` and `autotest-rails` support to `rspec-autotest` gem.
7
+ (Andy Lindeman)
40
8
 
41
9
  ### 2.99.0.beta1 / 2013-11-07
42
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0...v2.99.0.beta1)
10
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0...v2.99.0.beta1)
43
11
 
44
12
  Deprecations
45
13
 
@@ -61,7 +29,7 @@ Bug fixes
61
29
  in all of `rails` to use `rspec-rails`. (John Firebaugh)
62
30
 
63
31
  ### 2.14.0 / 2013-07-06
64
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0.rc1...v2.14.0)
32
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.14.0.rc1...v2.14.0)
65
33
 
66
34
  Bug fixes
67
35
 
@@ -73,7 +41,7 @@ Bug fixes
73
41
  Rails 4. (Andy Lindeman)
74
42
 
75
43
  ### 2.14.0.rc1 / 2013-05-27
76
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.13.2...v2.14.0.rc1)
44
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.13.2...v2.14.0.rc1)
77
45
 
78
46
  Enhancements
79
47
 
@@ -86,7 +54,7 @@ Bug fixes
86
54
  spec/ directory. (Benjamin Fleischer)
87
55
 
88
56
  ### 2.13.2 / 2013-05-18
89
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.13.1...v2.13.2)
57
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.13.1...v2.13.2)
90
58
 
91
59
  Bug fixes
92
60
 
@@ -96,8 +64,12 @@ Bug fixes
96
64
  * Code that checks Rails version numbers is more robust in cases where Rails is
97
65
  not fully loaded. (Andy Lindeman)
98
66
 
67
+ Enhancements
68
+
69
+ * Document how the spec/support directory works. (Sam Phippen)
70
+
99
71
  ### 2.13.1 / 2013-04-27
100
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.13.0...v2.13.1)
72
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.13.0...v2.13.1)
101
73
 
102
74
  Bug fixes
103
75
 
@@ -111,7 +83,7 @@ Bug fixes
111
83
  * Fix spacing in the install generator template (Taiki ONO)
112
84
 
113
85
  ### 2.13.0 / 2013-02-23
114
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.12.2...v2.13.0)
86
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.12.2...v2.13.0)
115
87
 
116
88
  Enhancements
117
89
 
@@ -126,7 +98,7 @@ Enhancements
126
98
  (Rudolf Schmidt)
127
99
 
128
100
  ### 2.12.2 / 2013-01-12
129
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.12.1...v2.12.2)
101
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.12.1...v2.12.2)
130
102
 
131
103
  Bug fixes
132
104
 
@@ -138,7 +110,7 @@ Bug fixes
138
110
  Lindeman)
139
111
 
140
112
  ### 2.12.1 / 2013-01-07
141
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.12.0...v2.12.1)
113
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.12.0...v2.12.1)
142
114
 
143
115
  Bug fixes
144
116
 
@@ -153,7 +125,7 @@ Bug fixes
153
125
  and generation of URLs from other contexts. (Andy Lindeman)
154
126
 
155
127
  ### 2.12.0 / 2012-11-12
156
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.11.4...v2.12.0)
128
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.11.4...v2.12.0)
157
129
 
158
130
  Enhancements
159
131
 
@@ -174,7 +146,7 @@ Bug fixes
174
146
  * Failures message for `be_new_record` are more useful (Andy Lindeman)
175
147
 
176
148
  ### 2.11.4 / 2012-10-14
177
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.11.0...v2.11.4)
149
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.11.0...v2.11.4)
178
150
 
179
151
  Capybara-2.0 integration support:
180
152
 
@@ -188,7 +160,7 @@ for background.
188
160
  2.11.1, .2, .3 were yanked due to errant documentation.
189
161
 
190
162
  ### 2.11.0 / 2012-07-07
191
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.10.1...v2.11.0)
163
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.10.1...v2.11.0)
192
164
 
193
165
  Enhancements
194
166
 
@@ -207,7 +179,7 @@ Bug fixes
207
179
  loads (Andy Lindeman)
208
180
 
209
181
  ### 2.10.1 / 2012-05-03
210
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.10.0...v2.10.1)
182
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.10.0...v2.10.1)
211
183
 
212
184
  Bug fixes
213
185
 
@@ -217,7 +189,7 @@ Bug fixes
217
189
  Rails already does this (Jack Dempsey)
218
190
 
219
191
  ### 2.10.0 / 2012-05-03
220
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.9.0...v2.10.0)
192
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.9.0...v2.10.0)
221
193
 
222
194
  Bug fixes
223
195
 
@@ -232,7 +204,7 @@ Bug fixes
232
204
  Strother)
233
205
 
234
206
  ### 2.9.0 / 2012-03-17
235
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.8.1...v2.9.0)
207
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.8.1...v2.9.0)
236
208
 
237
209
  Enhancements
238
210
 
@@ -247,7 +219,7 @@ Bug fixes
247
219
 
248
220
  ### 2.8.1 / 2012-01-04
249
221
 
250
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0...v2.8.1)
222
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0...v2.8.1)
251
223
 
252
224
  NOTE: there was a change in rails-3.2.0.rc2 which broke compatibility with
253
225
  stub_model in rspec-rails. This release fixes that issue, but it means that
@@ -260,7 +232,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
260
232
 
261
233
  ### 2.8.0 / 2012-01-04
262
234
 
263
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0.rc2...v2.8.0)
235
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.8.0.rc2...v2.8.0)
264
236
 
265
237
  * Enhancements
266
238
  * Eliminate deprecation warnings in generated view specs in Rails 3.2
@@ -270,7 +242,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
270
242
 
271
243
  ### 2.8.0.rc2 / 2011-12-19
272
244
 
273
- [Full Changelog](http://github.com/rspec/rspec-mocks/compare/v2.8.0.rc1...v2.8.0.rc2)
245
+ [full changelog](http://github.com/rspec/rspec-mocks/compare/v2.8.0.rc1...v2.8.0.rc2)
274
246
 
275
247
  * Enhancements
276
248
  * Add session hash to generated controller specs (Thiago Almeida)
@@ -282,7 +254,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
282
254
 
283
255
  ### 2.8.0.rc1 / 2011-11-06
284
256
 
285
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.7.0...v2.8.0.rc1)
257
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.7.0...v2.8.0.rc1)
286
258
 
287
259
  * Enhancements
288
260
  * Removed unnecessary "config.mock_with :rspec" from spec_helper.rb (Paul
@@ -298,7 +270,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
298
270
 
299
271
  ### 2.7.0 / 2011-10-16
300
272
 
301
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.6.1...v2.7.0)
273
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.6.1...v2.7.0)
302
274
 
303
275
  * Enhancements
304
276
  * `ActiveRecord::Relation` can use the `=~` matcher (Andy Lindeman)
@@ -323,7 +295,7 @@ you'll have to upgrade to rspec-rails-2.8.1 when you upgrade to rails >=
323
295
 
324
296
  ### 2.6.1 / 2011-05-25
325
297
 
326
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.6.0...v2.6.1)
298
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.6.0...v2.6.1)
327
299
 
328
300
  This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
329
301
 
@@ -334,7 +306,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
334
306
 
335
307
  ### 2.6.0 / 2011-05-12
336
308
 
337
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.5.0...v2.6.0)
309
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.5.0...v2.6.0)
338
310
 
339
311
  * Enhancements
340
312
  * rails 3 shortcuts for routing specs (Joe Fiorini)
@@ -358,7 +330,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
358
330
 
359
331
  ### 2.5.0 / 2011-02-05
360
332
 
361
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.4.1...v2.5.0)
333
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.1...v2.5.0)
362
334
 
363
335
  * Enhancements
364
336
  * use index_helper instead of table_name when generating specs (Reza
@@ -373,7 +345,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
373
345
 
374
346
  ### 2.4.1 / 2011-01-03
375
347
 
376
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.4.0...v2.4.1)
348
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.4.0...v2.4.1)
377
349
 
378
350
  * Bug fixes
379
351
  * fixed bug caused by including some Rails modules before RSpec's
@@ -381,7 +353,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
381
353
 
382
354
  ### 2.4.0 / 2011-01-02
383
355
 
384
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.3.1...v2.4.0)
356
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.1...v2.4.0)
385
357
 
386
358
  * Enhancements
387
359
  * include ApplicationHelper in helper object in helper specs
@@ -401,7 +373,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
401
373
 
402
374
  ### 2.3.1 / 2010-12-16
403
375
 
404
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.3.0...v2.3.1)
376
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.3.0...v2.3.1)
405
377
 
406
378
  * Bug fixes
407
379
  * respond_to? correctly handles 2 args
@@ -409,7 +381,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
409
381
 
410
382
  ### 2.3.0 / 2010-12-12
411
383
 
412
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.2.1...v2.3.0)
384
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.1...v2.3.0)
413
385
 
414
386
  * Changes
415
387
  * Generator no longer generates autotest/autodiscover.rb, as it is no longer
@@ -417,7 +389,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
417
389
 
418
390
  ### 2.2.1 / 2010-12-01
419
391
 
420
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.2.0...v2.2.1)
392
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.2.0...v2.2.1)
421
393
 
422
394
  * Bug fixes
423
395
  * Depend on railties, activesupport, and actionpack instead of rails (Piotr
@@ -429,7 +401,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
429
401
 
430
402
  ### 2.2.0 / 2010-11-28
431
403
 
432
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.1.0...v2.2.0)
404
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.1.0...v2.2.0)
433
405
 
434
406
  * Enhancements
435
407
  * Added stub_template in view specs
@@ -444,7 +416,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
444
416
 
445
417
  ### 2.1.0 / 2010-11-07
446
418
 
447
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.0.1...v2.1.0)
419
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.1...v2.1.0)
448
420
 
449
421
  * Enhancements
450
422
  * Move errors_on to ActiveModel to support other AM-compliant ORMs
@@ -455,7 +427,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
455
427
 
456
428
  ### 2.0.1 / 2010-10-15
457
429
 
458
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0...v2.0.1)
430
+ [full changelog](http://github.com/rspec/rspec-rails/compare/v2.0.0...v2.0.1)
459
431
 
460
432
  * Enhancements
461
433
  * Add option to not generate request spec (--skip-request-specs)
@@ -468,7 +440,7 @@ This release is compatible with rails-3.1.0.rc1, but not rails-3.1.0.beta1
468
440
 
469
441
  ### 2.0.0 / 2010-10-10
470
442
 
471
- [Full Changelog](https://github.com/rspec/rspec-rails/compare/ea6bdef...v2.0.0)
443
+ [full changelog](https://github.com/rspec/rspec-rails/compare/ea6bdef...v2.0.0)
472
444
 
473
445
  * Enhancements
474
446
  * ControllerExampleGroup uses controller as the implicit subject by default (Paul Rosania)
@@ -1,5 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
+ Copyright (c) 2012 David Chelimsky, Andy Lindeman
3
4
  Copyright (c) 2006 David Chelimsky, The RSpec Development Team
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining
data/README.md CHANGED
@@ -28,6 +28,9 @@ Initialize the `spec/` directory (where specs will reside) with:
28
28
  rails generate rspec:install
29
29
  ```
30
30
 
31
+ This adds `spec/spec_helper.rb` and `.rspec` files that are used for
32
+ configuration. See those files for more information.
33
+
31
34
  To run your specs, use the `rspec` command:
32
35
 
33
36
  ```
@@ -56,7 +59,7 @@ Once installed, RSpec will generate spec files instead of Test::Unit test files
56
59
  when commands like `rails generate model` and `rails generate controller` are
57
60
  used.
58
61
 
59
- You may also invoke invoke RSpec generators independently. For instance,
62
+ You may also invoke RSpec generators independently. For instance,
60
63
  running `rails generate rspec:model` will generate a model spec. For more
61
64
  information, see [list of all
62
65
  generators](https://www.relishapp.com/rspec/rspec-rails/docs/generators).
@@ -120,8 +123,7 @@ specs](https://www.relishapp.com/rspec/rspec-rails/docs/controller-specs).
120
123
  in controller specs. If you wish to assert against the contents of the rendered
121
124
  view in a controller spec, enable
122
125
  [render\_views](https://www.relishapp.com/rspec/rspec-rails/docs/controller-specs/render-views)
123
- or use a higher-level [request spec](#request-specs) or [feature
124
- spec](#feature-specs).
126
+ or use a higher-level [request spec](#request-specs).
125
127
 
126
128
  ## <a id="request-spec"></a>Request Specs
127
129
 
@@ -435,7 +437,7 @@ for more info on Capybara integration.
435
437
  See [http://github.com/rspec/rspec-dev](http://github.com/rspec/rspec-dev).
436
438
 
437
439
  For `rspec-rails`-specific development information, see
438
- [DEV-README](https://github.com/rspec/rspec-rails/blob/master/DEV-README.md).
440
+ [README_DEV](https://github.com/rspec/rspec-rails/blob/master/README_DEV.md).
439
441
 
440
442
  # Also see
441
443
 
@@ -0,0 +1,24 @@
1
+ RSpec spec are normally generated alongside other application components.
2
+ For instance, `rails generate model` will also generate an RSpec spec file
3
+ for the model.
4
+
5
+ Note that the generators are there to help you get started, but they are no
6
+ substitute for writing your own examples, and they are only guaranteed to work
7
+ out of the box for with Rails' defaults.
8
+
9
+ RSpec generators can also be run independently. For instance,
10
+
11
+ rails generate rspec:model widget
12
+
13
+ will create a new spec file in `spec/models/widget_spec.rb`.
14
+
15
+ The same generator pattern is available for all specs:
16
+
17
+ * scaffold
18
+ * model
19
+ * controller
20
+ * helper
21
+ * view
22
+ * mailer
23
+ * observer
24
+ * integration
@@ -0,0 +1,84 @@
1
+ Install Rails-3
2
+
3
+ $ gem install rails -v "~> 3.0.0"
4
+
5
+ ### Generate an app
6
+
7
+ $ rails new example
8
+ $ cd example
9
+
10
+ ### Add rspec-rails to the Gemfile
11
+
12
+ $ echo 'gem "rspec-rails", :group => [:development, :test]' >> Gemfile
13
+
14
+ ### Install the bundle
15
+
16
+ $ bundle install
17
+
18
+ ### Bootstrap RSpec
19
+
20
+ $ rails generate rspec:install
21
+
22
+ ### Generate a scaffold
23
+
24
+ $ rails generate scaffold Widgets name:string
25
+
26
+ This generates files in the `app` and `spec` directories. The files in the
27
+ `app` directory are generated by Rails, and Rails delegates the generation of
28
+ the files in the `spec` directory to RSpec.
29
+
30
+ ### Run migrations
31
+
32
+ $ rake db:migrate && rake db:test:prepare
33
+
34
+ ### Run RSpec
35
+
36
+ $ rake spec
37
+
38
+ or
39
+
40
+ $ rspec spec --format documentation
41
+
42
+ If all went well, you should see output ending with:
43
+
44
+ 29 examples, 0 failures, 2 pending
45
+
46
+ This output also includes the following controller spec:
47
+
48
+ WidgetsController
49
+ GET index
50
+ assigns all widgets as @widgets
51
+ GET show
52
+ assigns the requested widget as @widget
53
+ GET new
54
+ assigns a new widget as @widget
55
+ GET edit
56
+ assigns the requested widget as @widget
57
+ POST create
58
+ with valid params
59
+ creates a new Widget
60
+ assigns a newly created widget as @widget
61
+ redirects to the created widget
62
+ with invalid params
63
+ assigns a newly created but unsaved widget as @widget
64
+ re-renders the 'new' template
65
+ PUT update
66
+ with valid params
67
+ updates the requested widget
68
+ assigns the requested widget as @widget
69
+ redirects to the widget
70
+ with invalid params
71
+ assigns the widget as @widget
72
+ re-renders the 'edit' template
73
+ DELETE destroy
74
+ destroys the requested widget
75
+ redirects to the widgets list
76
+
77
+ Output like this can help to quickly gain a high level understanding of how an
78
+ object behaves. It also exposes which cases have been specified and which have
79
+ not. Note the balance between the examples for the `create` and `update`
80
+ actions. If the `redirects to the widget` example was missing from one or the
81
+ other, it would be easy to spot.
82
+
83
+ Take a look at the generated `spec/controllers/widgets_controller_spec.rb` to
84
+ get a sense of how to organize your specs to generate output like this.