cavalle-rspec-rails 1.2.2.0.1
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/.document +7 -0
- data/History.rdoc +207 -0
- data/License.txt +33 -0
- data/Manifest.txt +167 -0
- data/README.rdoc +45 -0
- data/Rakefile +79 -0
- data/TODO.txt +1 -0
- data/Upgrade.rdoc +103 -0
- data/features/step_definitions/people.rb +6 -0
- data/features/support/env.rb +13 -0
- data/features/transactions/transactions_should_rollback.feature +16 -0
- data/generators/rspec/CHANGES +1 -0
- data/generators/rspec/rspec_generator.rb +54 -0
- data/generators/rspec/templates/previous_failures.txt +0 -0
- data/generators/rspec/templates/rcov.opts +2 -0
- data/generators/rspec/templates/rspec.rake +165 -0
- data/generators/rspec/templates/script/autospec +6 -0
- data/generators/rspec/templates/script/spec +10 -0
- data/generators/rspec/templates/script/spec_server +9 -0
- data/generators/rspec/templates/spec.opts +4 -0
- data/generators/rspec/templates/spec_helper.rb +47 -0
- data/generators/rspec_controller/USAGE +33 -0
- data/generators/rspec_controller/rspec_controller_generator.rb +45 -0
- data/generators/rspec_controller/templates/controller_spec.rb +25 -0
- data/generators/rspec_controller/templates/helper_spec.rb +11 -0
- data/generators/rspec_controller/templates/view_spec.rb +12 -0
- data/generators/rspec_default_values.rb +19 -0
- data/generators/rspec_model/USAGE +18 -0
- data/generators/rspec_model/rspec_model_generator.rb +35 -0
- data/generators/rspec_model/templates/model_spec.rb +15 -0
- data/generators/rspec_scaffold/rspec_scaffold_generator.rb +150 -0
- data/generators/rspec_scaffold/templates/controller_spec.rb +171 -0
- data/generators/rspec_scaffold/templates/edit_erb_spec.rb +27 -0
- data/generators/rspec_scaffold/templates/helper_spec.rb +11 -0
- data/generators/rspec_scaffold/templates/index_erb_spec.rb +28 -0
- data/generators/rspec_scaffold/templates/new_erb_spec.rb +27 -0
- data/generators/rspec_scaffold/templates/routing_spec.rb +63 -0
- data/generators/rspec_scaffold/templates/show_erb_spec.rb +23 -0
- data/init.rb +9 -0
- data/lib/autotest/discover.rb +1 -0
- data/lib/autotest/rails_rspec.rb +76 -0
- data/lib/spec/rails/example/assigns_hash_proxy.rb +39 -0
- data/lib/spec/rails/example/controller_example_group.rb +247 -0
- data/lib/spec/rails/example/cookies_proxy.rb +29 -0
- data/lib/spec/rails/example/functional_example_group.rb +84 -0
- data/lib/spec/rails/example/helper_example_group.rb +153 -0
- data/lib/spec/rails/example/model_example_group.rb +14 -0
- data/lib/spec/rails/example/render_observer.rb +67 -0
- data/lib/spec/rails/example/routing_example_group.rb +13 -0
- data/lib/spec/rails/example/routing_helpers.rb +70 -0
- data/lib/spec/rails/example/view_example_group.rb +186 -0
- data/lib/spec/rails/example.rb +47 -0
- data/lib/spec/rails/extensions/action_controller/rescue.rb +42 -0
- data/lib/spec/rails/extensions/action_controller/test_case.rb +16 -0
- data/lib/spec/rails/extensions/action_controller/test_response.rb +21 -0
- data/lib/spec/rails/extensions/action_view/base.rb +33 -0
- data/lib/spec/rails/extensions/active_record/base.rb +45 -0
- data/lib/spec/rails/extensions/active_support/test_case.rb +7 -0
- data/lib/spec/rails/extensions/spec/matchers/have.rb +23 -0
- data/lib/spec/rails/extensions/spec/runner/configuration.rb +44 -0
- data/lib/spec/rails/extensions.rb +11 -0
- data/lib/spec/rails/interop/testcase.rb +14 -0
- data/lib/spec/rails/matchers/ar_be_valid.rb +44 -0
- data/lib/spec/rails/matchers/assert_select.rb +146 -0
- data/lib/spec/rails/matchers/change.rb +11 -0
- data/lib/spec/rails/matchers/have_text.rb +57 -0
- data/lib/spec/rails/matchers/include_text.rb +54 -0
- data/lib/spec/rails/matchers/redirect_to.rb +126 -0
- data/lib/spec/rails/matchers/render_template.rb +114 -0
- data/lib/spec/rails/matchers.rb +32 -0
- data/lib/spec/rails/mocks.rb +135 -0
- data/lib/spec/rails/spec_server.rb +127 -0
- data/lib/spec/rails/story_adapter.rb +79 -0
- data/lib/spec/rails/version.rb +15 -0
- data/lib/spec/rails.rb +28 -0
- data/rspec-rails.gemspec +57 -0
- data/spec/autotest/mappings_spec.rb +86 -0
- data/spec/rails_suite.rb +7 -0
- data/spec/resources/controllers/action_view_base_spec_controller.rb +2 -0
- data/spec/resources/controllers/application.rb +9 -0
- data/spec/resources/controllers/controller_spec_controller.rb +120 -0
- data/spec/resources/controllers/example.txt +1 -0
- data/spec/resources/controllers/redirect_spec_controller.rb +70 -0
- data/spec/resources/controllers/render_spec_controller.rb +30 -0
- data/spec/resources/controllers/rjs_spec_controller.rb +58 -0
- data/spec/resources/helpers/addition_helper.rb +5 -0
- data/spec/resources/helpers/explicit_helper.rb +46 -0
- data/spec/resources/helpers/more_explicit_helper.rb +5 -0
- data/spec/resources/helpers/plugin_application_helper.rb +6 -0
- data/spec/resources/helpers/view_spec_helper.rb +13 -0
- data/spec/resources/models/animal.rb +4 -0
- data/spec/resources/models/person.rb +18 -0
- data/spec/resources/models/thing.rb +3 -0
- data/spec/resources/views/controller_spec/_partial.html.erb +0 -0
- data/spec/resources/views/controller_spec/action_setting_flash_after_session_reset.html.erb +1 -0
- data/spec/resources/views/controller_spec/action_setting_flash_before_session_reset.html.erb +1 -0
- data/spec/resources/views/controller_spec/action_setting_the_assigns_hash.html.erb +0 -0
- data/spec/resources/views/controller_spec/action_with_errors_in_template.html.erb +1 -0
- data/spec/resources/views/controller_spec/action_with_template.html.erb +1 -0
- data/spec/resources/views/layouts/application.html.erb +0 -0
- data/spec/resources/views/layouts/simple.html.erb +0 -0
- data/spec/resources/views/objects/_object.html.erb +1 -0
- data/spec/resources/views/render_spec/_a_partial.html.erb +0 -0
- data/spec/resources/views/render_spec/action_with_alternate_layout.html.erb +0 -0
- data/spec/resources/views/render_spec/some_action.html.erb +0 -0
- data/spec/resources/views/render_spec/some_action.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/_replacement_partial.html.erb +1 -0
- data/spec/resources/views/rjs_spec/hide_div.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/hide_page_element.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/insert_html.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/replace.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/replace_html.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/replace_html_with_partial.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/visual_effect.js.rjs +1 -0
- data/spec/resources/views/rjs_spec/visual_toggle_effect.js.rjs +1 -0
- data/spec/resources/views/tag_spec/no_tags.html.erb +1 -0
- data/spec/resources/views/tag_spec/single_div_with_no_attributes.html.erb +1 -0
- data/spec/resources/views/tag_spec/single_div_with_one_attribute.html.erb +1 -0
- data/spec/resources/views/view_spec/_partial.html.erb +2 -0
- data/spec/resources/views/view_spec/_partial_used_twice.html.erb +0 -0
- data/spec/resources/views/view_spec/_partial_with_local_variable.html.erb +1 -0
- data/spec/resources/views/view_spec/_partial_with_sub_partial.html.erb +1 -0
- data/spec/resources/views/view_spec/_spacer.html.erb +1 -0
- data/spec/resources/views/view_spec/accessor.html.erb +5 -0
- data/spec/resources/views/view_spec/block_helper.html.erb +3 -0
- data/spec/resources/views/view_spec/entry_form.html.erb +2 -0
- data/spec/resources/views/view_spec/explicit_helper.html.erb +2 -0
- data/spec/resources/views/view_spec/foo/show.html.erb +1 -0
- data/spec/resources/views/view_spec/implicit_helper.html.erb +2 -0
- data/spec/resources/views/view_spec/multiple_helpers.html.erb +3 -0
- data/spec/resources/views/view_spec/path_params.html.erb +1 -0
- data/spec/resources/views/view_spec/should_not_receive.html.erb +3 -0
- data/spec/resources/views/view_spec/template_with_partial.html.erb +5 -0
- data/spec/resources/views/view_spec/template_with_partial_using_collection.html.erb +3 -0
- data/spec/resources/views/view_spec/template_with_partial_with_array.html.erb +1 -0
- data/spec/spec/rails/example/assigns_hash_proxy_spec.rb +109 -0
- data/spec/spec/rails/example/configuration_spec.rb +65 -0
- data/spec/spec/rails/example/controller_example_group_spec.rb +299 -0
- data/spec/spec/rails/example/controller_isolation_spec.rb +56 -0
- data/spec/spec/rails/example/cookies_proxy_spec.rb +87 -0
- data/spec/spec/rails/example/error_handling_spec.rb +90 -0
- data/spec/spec/rails/example/example_group_factory_spec.rb +112 -0
- data/spec/spec/rails/example/helper_example_group_spec.rb +233 -0
- data/spec/spec/rails/example/model_example_group_spec.rb +20 -0
- data/spec/spec/rails/example/routing_example_group_spec.rb +9 -0
- data/spec/spec/rails/example/shared_routing_example_group_examples.rb +44 -0
- data/spec/spec/rails/example/test_unit_assertion_accessibility_spec.rb +33 -0
- data/spec/spec/rails/example/view_example_group_spec.rb +335 -0
- data/spec/spec/rails/extensions/action_view_base_spec.rb +48 -0
- data/spec/spec/rails/extensions/active_record_spec.rb +14 -0
- data/spec/spec/rails/interop/testcase_spec.rb +70 -0
- data/spec/spec/rails/matchers/ar_be_valid_spec.rb +45 -0
- data/spec/spec/rails/matchers/assert_select_spec.rb +809 -0
- data/spec/spec/rails/matchers/errors_on_spec.rb +25 -0
- data/spec/spec/rails/matchers/have_text_spec.rb +70 -0
- data/spec/spec/rails/matchers/include_text_spec.rb +62 -0
- data/spec/spec/rails/matchers/redirect_to_spec.rb +253 -0
- data/spec/spec/rails/matchers/render_template_spec.rb +191 -0
- data/spec/spec/rails/matchers/should_change_spec.rb +15 -0
- data/spec/spec/rails/mocks/ar_classes.rb +10 -0
- data/spec/spec/rails/mocks/mock_model_spec.rb +106 -0
- data/spec/spec/rails/mocks/stub_model_spec.rb +80 -0
- data/spec/spec/rails/sample_modified_fixture.rb +8 -0
- data/spec/spec/rails/sample_spec.rb +8 -0
- data/spec/spec/rails/spec_server_spec.rb +107 -0
- data/spec/spec/rails/spec_spec.rb +11 -0
- data/spec/spec_helper.rb +79 -0
- metadata +277 -0
data/.document
ADDED
data/History.rdoc
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
=== Version 1.2.2 / 2009-03-22
|
2
|
+
|
3
|
+
No changes in this release, but aligns with the rspec-1.2.2 release.
|
4
|
+
|
5
|
+
=== Version 1.2.1 / 2009-03-22
|
6
|
+
|
7
|
+
This is a bug-fix release, recommended for anybody who has already upgraded to
|
8
|
+
rspec-rails-1.2.0 or is upgrading to rails-2.3.2
|
9
|
+
|
10
|
+
See Upgrade.rdoc for information about upgrading to rspec-rails-1.2.1
|
11
|
+
|
12
|
+
* enhancements
|
13
|
+
|
14
|
+
* more cleanup of internals (reducing dependency on rspec-core)
|
15
|
+
* don't require config/environments more than once
|
16
|
+
* autotest includes spec/routing directory (Matt Peterson). Closes #739.
|
17
|
+
* display helpful messages when installing rspec-rails running script/generate rspec
|
18
|
+
* thanks for Dr Nic for the pointers
|
19
|
+
* restored require 'rubygems' where needed
|
20
|
+
* export NO_RUBYGEMS=true if you don't use rubygems
|
21
|
+
|
22
|
+
* bug fixes
|
23
|
+
|
24
|
+
* fix scoping issues in rspec-rails' own suite for ruby 1.9.1 (Matthias
|
25
|
+
Hennemeyer). Closes #717.
|
26
|
+
* rake stats no longer hides test directories. Closes #748.
|
27
|
+
* fixed regression that was introduced in 1.2 in which controller_name
|
28
|
+
failed to override the controller class passed to describe() (patches from
|
29
|
+
Aaron Gibralter and Zach Dennis). Closes #732.
|
30
|
+
|
31
|
+
=== Version 1.2.0 / 2009-03-15
|
32
|
+
|
33
|
+
IMPORTANT: See Upgrade.rdoc for information about upgrading to rspec-rails-1.2.0
|
34
|
+
|
35
|
+
IMPORTANT: This release includes the following backwards-compatibility-breaking changes.
|
36
|
+
|
37
|
+
* rspec-rails supports rails 2.0.2, 2.1.2, 2.2.2 and 2.3.2
|
38
|
+
|
39
|
+
* We are no longer supporting 1.x versions of rails.
|
40
|
+
|
41
|
+
* expect_render and stub_render have been removed.
|
42
|
+
|
43
|
+
* Both of these methods were deprecated in rspec-rails-1.1.5, released in Sept, 2008.
|
44
|
+
|
45
|
+
* { route_for(args).should == "/path" } now delegates to assert_generates (in rails)
|
46
|
+
|
47
|
+
* see Upgrade.txt for more information
|
48
|
+
|
49
|
+
* deprecations
|
50
|
+
|
51
|
+
* controller.use_rails_error_handling! is deprecated
|
52
|
+
* use rescue_action_in_public! (from rails) instead
|
53
|
+
|
54
|
+
* enhancements
|
55
|
+
|
56
|
+
* Adding status codes to redirect_to matcher (Damian Janowski). Closes #570.
|
57
|
+
* Initialize current URL before executing any examples in a ViewExampleGroup (Wilson Bilkovich). Closes #654.
|
58
|
+
* Support query strings in params_from (Wilson Bilkovich). Closes #652.
|
59
|
+
* delegate route_for to assert_recognizes (less brittle)
|
60
|
+
* it { should be_valid } (Kakutani). Closes #665.
|
61
|
+
* controller is implicit subject in controller specs (Joe Ferris). #686.
|
62
|
+
* template is implicit subject in view specs (Joe Ferris). #686.
|
63
|
+
* redirect_to and render_template matchers can accept controller or response (Joe Ferris). Closes #686.
|
64
|
+
* generated specs use declarative docstrings
|
65
|
+
* rspec_scaffold generator generates layout and stylesheet (per Rails-2.3)
|
66
|
+
* add bypass_rescue for controller specs
|
67
|
+
* infer template path from the first arg passed to describe in view specs
|
68
|
+
* separate routing specs (in spec/routing)
|
69
|
+
|
70
|
+
* bug fixes
|
71
|
+
|
72
|
+
* you no longer *have* to load ActionMailer to get specs to run. Closes #650.
|
73
|
+
* query_params are now parsed by Rack::Utils.parse_query in redirect_to matcher. Closes #684.
|
74
|
+
* cleaned up spec_server (there was a bunch of pre-rails 2.0 material). Closes #685.
|
75
|
+
* rspec's rake tasks are not loaded when running "rake gems" or any of its subtasks
|
76
|
+
* only warn when rspec is not installed when trying to invoke an rspec rake task
|
77
|
+
* support 2 arg version of ActionController::Base#render (reported by Nathan Wilmes)
|
78
|
+
* rake spec:server:start doesn't choke if there is no tmp directory
|
79
|
+
* force cache_classes = false when running with spec_server. Closes #287.
|
80
|
+
* keep spec_server working against edge rails (Jonathan Tron). Closes #685.
|
81
|
+
* create lib/tasks if not present when running script/generate rspec. Closes #687.
|
82
|
+
* fixed regression (and added spec so it won't regress again) where
|
83
|
+
render => :inline didn't render unless integrate_views was set
|
84
|
+
* fixed nil.with_output_buffer bug in helper specs. Closes #719.
|
85
|
+
|
86
|
+
=== Version 1.1.12 / 2009-01-11
|
87
|
+
|
88
|
+
* 2 deprecations
|
89
|
+
|
90
|
+
* TestResponse#[] is deprecated if you're using Rails <= 2.2.x and removed if you're using Rails 2.3
|
91
|
+
* add_stubs(model, {:method => value}) is deprecated. Use model.stub!(:method => value) instead.
|
92
|
+
|
93
|
+
* 2 major enhancements
|
94
|
+
|
95
|
+
* support controller and action path params in view specs (Mike Vincent).
|
96
|
+
* use ActiveSupport::TestCase when available, else Test::Unit::TestCase - supports Rails 1.2.6 (Brandon Keepers). Closes #620.
|
97
|
+
* support form tag helpers in helpers (Ivo Dancet). Closes #641.
|
98
|
+
|
99
|
+
* 3 minor enhancements
|
100
|
+
|
101
|
+
* improve rdoc for render_template (Patch from Andrew Premdas). Fixes #571.
|
102
|
+
* use more liberal globs to allow for specs in symlinked dirs (Martin Luder). Closes #361.
|
103
|
+
* Enable loading fixtures from arbitrary locations (Jacek Becela). Closes #464.
|
104
|
+
|
105
|
+
* 7 bug fixes
|
106
|
+
|
107
|
+
* Attempt to load application_controller before falling back to application (Geoff Garside). Closes #626.
|
108
|
+
* Include _id and reduce quoting of default values in view specs (Steen Lehmann). Closes #598.
|
109
|
+
* Record calls to render and check rendered[:template] and rendered[:partial] for edge rails (> v2.2.2). Closes #633.
|
110
|
+
* config.gem 'rspec' can't be unpacked. Closes #629.
|
111
|
+
* spec_server not working with Rails 2.2.2 (Andreas Wolff). Closes #631.
|
112
|
+
* redirect_to doesn't work with http method constrained urls (Maxim Kulkin). Closes #648.
|
113
|
+
* rescue_with declarations are no longer by-passed (Brandon Keepers). #85
|
114
|
+
|
115
|
+
=== Version 1.1.11 / 2008-10-24
|
116
|
+
|
117
|
+
* No changes to rspec-rails - release to align with bug-fix release in rspec ... again :(
|
118
|
+
|
119
|
+
=== Version 1.1.10 / 2008-10-24
|
120
|
+
|
121
|
+
* No changes to rspec-rails - release to align with bug-fix release in rspec
|
122
|
+
|
123
|
+
=== Version 1.1.9 / 2008-10-20
|
124
|
+
|
125
|
+
* 4 bug fixes
|
126
|
+
|
127
|
+
* require 'rubygems' in script/spec
|
128
|
+
* fix failure message for error_on and errors_on (Patch from Mike Vincent). Fixes #566.
|
129
|
+
* fix issues that arise in view spec if passing actual template name to render (Patch from Mike Vincent). Fixes #551.
|
130
|
+
* fixed bug accessing assigns from helper examples
|
131
|
+
|
132
|
+
=== Version 1.1.8 / 2008-10-03
|
133
|
+
|
134
|
+
* 2 bug fixes
|
135
|
+
|
136
|
+
* correctly handle assigns that are false. Fixes #552.
|
137
|
+
* ensure that NotYetImplemented examples report as pending (fixed in rspec, not rspec-rails). Fixes #553.
|
138
|
+
|
139
|
+
=== Version 1.1.7 / 2008-10-02
|
140
|
+
|
141
|
+
* 1 bug fix
|
142
|
+
|
143
|
+
* depend on the correct version of rspec
|
144
|
+
|
145
|
+
=== Version 1.1.6 / 2008-10-02
|
146
|
+
|
147
|
+
* 1 bug fix
|
148
|
+
|
149
|
+
* fixed regression where values assigned to the assigns hash were not accessible from the example (#549)
|
150
|
+
|
151
|
+
=== Version 1.1.5 / 2008-09-28
|
152
|
+
|
153
|
+
IMPORTANT: use 'script/autospec' (or just 'autospec' if you have the rspec gem
|
154
|
+
installed) instead of 'autotest'. We changed the way autotest discovers rspec
|
155
|
+
so the autotest executable won't automatically load rspec anymore. This allows
|
156
|
+
rspec to live side by side other spec frameworks without always co-opting
|
157
|
+
autotest through autotest's discovery mechanism.
|
158
|
+
|
159
|
+
ALSO IMPORTANT: Rails v2.1.1 changed assert_select_rjs such that it doesn't
|
160
|
+
always fail when it should. Please see
|
161
|
+
http://rails.lighthouseapp.com/projects/8994/tickets/982.
|
162
|
+
|
163
|
+
* Generated route specs have shorter names, making it less painful to modify their implementation
|
164
|
+
* Add conditional so Rails 2.1.0 doesn't warn about cache_template_extensions (patch from James Herdman)
|
165
|
+
* Fixed stub_model examples to work with Rails 2.1.0 (the code was fine, just the examples needed patching)
|
166
|
+
* use hoe for build/release
|
167
|
+
* reworked generated examples for rspec_scaffold - thanks to Mikel Lindsaar and Dan Manges for their feedback
|
168
|
+
* bye, bye translator
|
169
|
+
* Added proxy to cookies so you can set them in examples the same way you set them in controllers
|
170
|
+
* Added script/autospec so you can run autospec without installing the gem
|
171
|
+
* Support --skip-fixture in the rspec_model generator (patches from Alex Tomlins and Niels Ganser)
|
172
|
+
* Add mock_model#as_new_record (patch from Zach Dennis)
|
173
|
+
* mock(:null_object=>true) plays nice with HTML (patch from Gerrit Kaiser)
|
174
|
+
* Suppress a deprecation notice in Rails 2.1 (James Herdman)
|
175
|
+
* quiet deprecation warning on inflector (RSL)
|
176
|
+
* rspec-rails gem (Ben Mabey)
|
177
|
+
* updated generated code examples
|
178
|
+
* Make rspec_model generator honour --skip-fixtures tag (Niels Ganser, Alex Tomlins)
|
179
|
+
* Fix to create new models with attributes in command line (Nicolas)
|
180
|
+
* fix to_param in mock_model with stubbed id incorrectly returning autogenerated id (Adam Meehan)
|
181
|
+
* Call Rail's TestCase setup/teardown callbacks (Jonathan del Strother)
|
182
|
+
* Only run TestUnitTesting once (Jonathan del Strother)
|
183
|
+
* use require_dependency instead of require (Brandon Keepers)
|
184
|
+
* Fixed a problem caused by controller action names getting out of sync between rspec-dev and rspec-rails for speccing (Matt Patterson)
|
185
|
+
* don't mutate hash passed to mock_model (Reg Vos)
|
186
|
+
|
187
|
+
=== Version 1.1.4
|
188
|
+
|
189
|
+
Maintenance release.
|
190
|
+
|
191
|
+
* Moved mock_model and stub_model to their own module: Spec::Rails::Mocks
|
192
|
+
* Setting mock_model object id with stubs hash - patch from Adam Meehan
|
193
|
+
* Added as_new_record to stub_model e.g. stub_model(Foo).as_new_record
|
194
|
+
* Improved stub_model such that new_record? does "the right thing"
|
195
|
+
* Patch from Pat Maddox to get integrate_views to work in nested example groups.
|
196
|
+
* Patch from Pat Maddox to get controller_name to work in nested example groups.
|
197
|
+
* Patch from Corey Haines to add include_text matcher
|
198
|
+
* Added stub_model method which creates a real model instance with :id stubbed and data access prohibited.
|
199
|
+
* Applied patch from Pat Maddox to handle redirect_to w/ SSL. Closes #320.
|
200
|
+
* Added #helper and #assigns to helper specs.
|
201
|
+
* Applied patch from Bryan Helmkamp to tweak format of generated spec.opts to be more obvious. Closes #162.
|
202
|
+
* Tweaked list of exceptions (ignores) for autotest
|
203
|
+
* Applied patch from Rick Olson to get rspec_on_rails working with rails edge (>= 8862)
|
204
|
+
* Applied patch from Wincent Colaiuta to invert sense of "spec --diff". Closes #281.
|
205
|
+
* Allow any type of render in view specs. Closes #57.
|
206
|
+
* Applied patch from Ian White to get rspec working with edge rails (8804). Closes #271.
|
207
|
+
* Applied patch from Jon Strother to have spec_server reload fixtures. Closes #344.
|
data/License.txt
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
====================================================================
|
4
|
+
==== RSpec, RSpec-Rails
|
5
|
+
Copyright (c) 2005-2009 The RSpec Development Team
|
6
|
+
====================================================================
|
7
|
+
==== ARTS
|
8
|
+
Copyright (c) 2006 Kevin Clark, Jake Howerton
|
9
|
+
====================================================================
|
10
|
+
==== ZenTest
|
11
|
+
Copyright (c) 2001-2006 Ryan Davis, Eric Hodel, Zen Spider Software
|
12
|
+
====================================================================
|
13
|
+
==== AssertSelect
|
14
|
+
Copyright (c) 2006 Assaf Arkin
|
15
|
+
====================================================================
|
16
|
+
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
18
|
+
this software and associated documentation files (the "Software"), to deal in
|
19
|
+
the Software without restriction, including without limitation the rights to
|
20
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
21
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
22
|
+
so, subject to the following conditions:
|
23
|
+
|
24
|
+
The above copyright notice and this permission notice shall be included in all
|
25
|
+
copies or substantial portions of the Software.
|
26
|
+
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
28
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
29
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
30
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
31
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
32
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
33
|
+
SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
.document
|
2
|
+
History.rdoc
|
3
|
+
License.txt
|
4
|
+
Manifest.txt
|
5
|
+
README.rdoc
|
6
|
+
Rakefile
|
7
|
+
TODO.txt
|
8
|
+
Upgrade.rdoc
|
9
|
+
features/step_definitions/people.rb
|
10
|
+
features/support/env.rb
|
11
|
+
features/transactions/transactions_should_rollback.feature
|
12
|
+
generators/rspec/CHANGES
|
13
|
+
generators/rspec/rspec_generator.rb
|
14
|
+
generators/rspec/templates/previous_failures.txt
|
15
|
+
generators/rspec/templates/rcov.opts
|
16
|
+
generators/rspec/templates/rspec.rake
|
17
|
+
generators/rspec/templates/script/autospec
|
18
|
+
generators/rspec/templates/script/spec
|
19
|
+
generators/rspec/templates/script/spec_server
|
20
|
+
generators/rspec/templates/spec.opts
|
21
|
+
generators/rspec/templates/spec_helper.rb
|
22
|
+
generators/rspec_controller/USAGE
|
23
|
+
generators/rspec_controller/rspec_controller_generator.rb
|
24
|
+
generators/rspec_controller/templates/controller_spec.rb
|
25
|
+
generators/rspec_controller/templates/helper_spec.rb
|
26
|
+
generators/rspec_controller/templates/view_spec.rb
|
27
|
+
generators/rspec_default_values.rb
|
28
|
+
generators/rspec_model/USAGE
|
29
|
+
generators/rspec_model/rspec_model_generator.rb
|
30
|
+
generators/rspec_model/templates/model_spec.rb
|
31
|
+
generators/rspec_scaffold/rspec_scaffold_generator.rb
|
32
|
+
generators/rspec_scaffold/templates/controller_spec.rb
|
33
|
+
generators/rspec_scaffold/templates/edit_erb_spec.rb
|
34
|
+
generators/rspec_scaffold/templates/helper_spec.rb
|
35
|
+
generators/rspec_scaffold/templates/index_erb_spec.rb
|
36
|
+
generators/rspec_scaffold/templates/new_erb_spec.rb
|
37
|
+
generators/rspec_scaffold/templates/routing_spec.rb
|
38
|
+
generators/rspec_scaffold/templates/show_erb_spec.rb
|
39
|
+
init.rb
|
40
|
+
lib/autotest/discover.rb
|
41
|
+
lib/autotest/rails_rspec.rb
|
42
|
+
lib/spec/rails.rb
|
43
|
+
lib/spec/rails/example.rb
|
44
|
+
lib/spec/rails/example/assigns_hash_proxy.rb
|
45
|
+
lib/spec/rails/example/controller_example_group.rb
|
46
|
+
lib/spec/rails/example/cookies_proxy.rb
|
47
|
+
lib/spec/rails/example/functional_example_group.rb
|
48
|
+
lib/spec/rails/example/helper_example_group.rb
|
49
|
+
lib/spec/rails/example/model_example_group.rb
|
50
|
+
lib/spec/rails/example/render_observer.rb
|
51
|
+
lib/spec/rails/example/routing_example_group.rb
|
52
|
+
lib/spec/rails/example/routing_helpers.rb
|
53
|
+
lib/spec/rails/example/view_example_group.rb
|
54
|
+
lib/spec/rails/extensions.rb
|
55
|
+
lib/spec/rails/extensions/action_controller/rescue.rb
|
56
|
+
lib/spec/rails/extensions/action_controller/test_case.rb
|
57
|
+
lib/spec/rails/extensions/action_controller/test_response.rb
|
58
|
+
lib/spec/rails/extensions/action_view/base.rb
|
59
|
+
lib/spec/rails/extensions/active_record/base.rb
|
60
|
+
lib/spec/rails/extensions/active_support/test_case.rb
|
61
|
+
lib/spec/rails/extensions/spec/matchers/have.rb
|
62
|
+
lib/spec/rails/extensions/spec/runner/configuration.rb
|
63
|
+
lib/spec/rails/interop/testcase.rb
|
64
|
+
lib/spec/rails/matchers.rb
|
65
|
+
lib/spec/rails/matchers/ar_be_valid.rb
|
66
|
+
lib/spec/rails/matchers/assert_select.rb
|
67
|
+
lib/spec/rails/matchers/change.rb
|
68
|
+
lib/spec/rails/matchers/have_text.rb
|
69
|
+
lib/spec/rails/matchers/include_text.rb
|
70
|
+
lib/spec/rails/matchers/redirect_to.rb
|
71
|
+
lib/spec/rails/matchers/render_template.rb
|
72
|
+
lib/spec/rails/mocks.rb
|
73
|
+
lib/spec/rails/spec_server.rb
|
74
|
+
lib/spec/rails/story_adapter.rb
|
75
|
+
lib/spec/rails/version.rb
|
76
|
+
rspec-rails.gemspec
|
77
|
+
spec/autotest/mappings_spec.rb
|
78
|
+
spec/rails_suite.rb
|
79
|
+
spec/resources/controllers/action_view_base_spec_controller.rb
|
80
|
+
spec/resources/controllers/application.rb
|
81
|
+
spec/resources/controllers/controller_spec_controller.rb
|
82
|
+
spec/resources/controllers/example.txt
|
83
|
+
spec/resources/controllers/redirect_spec_controller.rb
|
84
|
+
spec/resources/controllers/render_spec_controller.rb
|
85
|
+
spec/resources/controllers/rjs_spec_controller.rb
|
86
|
+
spec/resources/helpers/addition_helper.rb
|
87
|
+
spec/resources/helpers/explicit_helper.rb
|
88
|
+
spec/resources/helpers/more_explicit_helper.rb
|
89
|
+
spec/resources/helpers/plugin_application_helper.rb
|
90
|
+
spec/resources/helpers/view_spec_helper.rb
|
91
|
+
spec/resources/models/animal.rb
|
92
|
+
spec/resources/models/person.rb
|
93
|
+
spec/resources/models/thing.rb
|
94
|
+
spec/resources/views/controller_spec/_partial.html.erb
|
95
|
+
spec/resources/views/controller_spec/action_setting_flash_after_session_reset.html.erb
|
96
|
+
spec/resources/views/controller_spec/action_setting_flash_before_session_reset.html.erb
|
97
|
+
spec/resources/views/controller_spec/action_setting_the_assigns_hash.html.erb
|
98
|
+
spec/resources/views/controller_spec/action_with_errors_in_template.html.erb
|
99
|
+
spec/resources/views/controller_spec/action_with_template.html.erb
|
100
|
+
spec/resources/views/layouts/application.html.erb
|
101
|
+
spec/resources/views/layouts/simple.html.erb
|
102
|
+
spec/resources/views/objects/_object.html.erb
|
103
|
+
spec/resources/views/render_spec/_a_partial.html.erb
|
104
|
+
spec/resources/views/render_spec/action_with_alternate_layout.html.erb
|
105
|
+
spec/resources/views/render_spec/some_action.html.erb
|
106
|
+
spec/resources/views/render_spec/some_action.js.rjs
|
107
|
+
spec/resources/views/rjs_spec/_replacement_partial.html.erb
|
108
|
+
spec/resources/views/rjs_spec/hide_div.js.rjs
|
109
|
+
spec/resources/views/rjs_spec/hide_page_element.js.rjs
|
110
|
+
spec/resources/views/rjs_spec/insert_html.js.rjs
|
111
|
+
spec/resources/views/rjs_spec/replace.js.rjs
|
112
|
+
spec/resources/views/rjs_spec/replace_html.js.rjs
|
113
|
+
spec/resources/views/rjs_spec/replace_html_with_partial.js.rjs
|
114
|
+
spec/resources/views/rjs_spec/visual_effect.js.rjs
|
115
|
+
spec/resources/views/rjs_spec/visual_toggle_effect.js.rjs
|
116
|
+
spec/resources/views/tag_spec/no_tags.html.erb
|
117
|
+
spec/resources/views/tag_spec/single_div_with_no_attributes.html.erb
|
118
|
+
spec/resources/views/tag_spec/single_div_with_one_attribute.html.erb
|
119
|
+
spec/resources/views/view_spec/_partial.html.erb
|
120
|
+
spec/resources/views/view_spec/_partial_used_twice.html.erb
|
121
|
+
spec/resources/views/view_spec/_partial_with_local_variable.html.erb
|
122
|
+
spec/resources/views/view_spec/_partial_with_sub_partial.html.erb
|
123
|
+
spec/resources/views/view_spec/_spacer.html.erb
|
124
|
+
spec/resources/views/view_spec/accessor.html.erb
|
125
|
+
spec/resources/views/view_spec/block_helper.html.erb
|
126
|
+
spec/resources/views/view_spec/entry_form.html.erb
|
127
|
+
spec/resources/views/view_spec/explicit_helper.html.erb
|
128
|
+
spec/resources/views/view_spec/foo/show.html.erb
|
129
|
+
spec/resources/views/view_spec/implicit_helper.html.erb
|
130
|
+
spec/resources/views/view_spec/multiple_helpers.html.erb
|
131
|
+
spec/resources/views/view_spec/path_params.html.erb
|
132
|
+
spec/resources/views/view_spec/should_not_receive.html.erb
|
133
|
+
spec/resources/views/view_spec/template_with_partial.html.erb
|
134
|
+
spec/resources/views/view_spec/template_with_partial_using_collection.html.erb
|
135
|
+
spec/resources/views/view_spec/template_with_partial_with_array.html.erb
|
136
|
+
spec/spec/rails/example/assigns_hash_proxy_spec.rb
|
137
|
+
spec/spec/rails/example/configuration_spec.rb
|
138
|
+
spec/spec/rails/example/controller_example_group_spec.rb
|
139
|
+
spec/spec/rails/example/controller_isolation_spec.rb
|
140
|
+
spec/spec/rails/example/cookies_proxy_spec.rb
|
141
|
+
spec/spec/rails/example/error_handling_spec.rb
|
142
|
+
spec/spec/rails/example/example_group_factory_spec.rb
|
143
|
+
spec/spec/rails/example/helper_example_group_spec.rb
|
144
|
+
spec/spec/rails/example/model_example_group_spec.rb
|
145
|
+
spec/spec/rails/example/routing_example_group_spec.rb
|
146
|
+
spec/spec/rails/example/shared_routing_example_group_examples.rb
|
147
|
+
spec/spec/rails/example/test_unit_assertion_accessibility_spec.rb
|
148
|
+
spec/spec/rails/example/view_example_group_spec.rb
|
149
|
+
spec/spec/rails/extensions/action_view_base_spec.rb
|
150
|
+
spec/spec/rails/extensions/active_record_spec.rb
|
151
|
+
spec/spec/rails/interop/testcase_spec.rb
|
152
|
+
spec/spec/rails/matchers/ar_be_valid_spec.rb
|
153
|
+
spec/spec/rails/matchers/assert_select_spec.rb
|
154
|
+
spec/spec/rails/matchers/errors_on_spec.rb
|
155
|
+
spec/spec/rails/matchers/have_text_spec.rb
|
156
|
+
spec/spec/rails/matchers/include_text_spec.rb
|
157
|
+
spec/spec/rails/matchers/redirect_to_spec.rb
|
158
|
+
spec/spec/rails/matchers/render_template_spec.rb
|
159
|
+
spec/spec/rails/matchers/should_change_spec.rb
|
160
|
+
spec/spec/rails/mocks/ar_classes.rb
|
161
|
+
spec/spec/rails/mocks/mock_model_spec.rb
|
162
|
+
spec/spec/rails/mocks/stub_model_spec.rb
|
163
|
+
spec/spec/rails/sample_modified_fixture.rb
|
164
|
+
spec/spec/rails/sample_spec.rb
|
165
|
+
spec/spec/rails/spec_server_spec.rb
|
166
|
+
spec/spec/rails/spec_spec.rb
|
167
|
+
spec/spec_helper.rb
|
data/README.rdoc
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
= Spec::Rails
|
2
|
+
|
3
|
+
* http://rspec.info
|
4
|
+
* http://rubyforge.org/projects/rspec
|
5
|
+
* http://github.com/dchelimsky/rspec-rails
|
6
|
+
* http://wiki.github.com/dchelimsky/rspec/rails
|
7
|
+
* mailto:rspec-devel@rubyforge.org
|
8
|
+
|
9
|
+
== DESCRIPTION:
|
10
|
+
|
11
|
+
Behaviour Driven Development for Ruby on Rails.
|
12
|
+
|
13
|
+
rspec-rails is an RSpec extension that allows you to drive the development of
|
14
|
+
Ruby on Rails applications with RSpec.
|
15
|
+
|
16
|
+
== FEATURES:
|
17
|
+
|
18
|
+
* Use RSpec to independently specify Rails Models, Views, Controllers and Helpers
|
19
|
+
* Integrated fixture loading
|
20
|
+
* Special generators for Resources, Models, Views and Controllers that generate RSpec code examples.
|
21
|
+
|
22
|
+
== VISION:
|
23
|
+
|
24
|
+
For people for whom TDD is a brand new concept, the testing support built into
|
25
|
+
Ruby on Rails is a huge leap forward. The fact that it is built right in is
|
26
|
+
fantastic, and Ruby on Rails apps are generally much easier to maintain than
|
27
|
+
they might have been without such support.
|
28
|
+
|
29
|
+
For those of us coming from a history with TDD, and now BDD, the existing
|
30
|
+
support presents some problems related to dependencies across examples. To
|
31
|
+
that end, RSpec on Rails supports 4 types of examples. We’ve also built in
|
32
|
+
first class mocking and stubbing support in order to break dependencies across
|
33
|
+
these different concerns.
|
34
|
+
|
35
|
+
== MORE INFORMATION:
|
36
|
+
|
37
|
+
See Spec::Rails::Example for information about the different kinds of example
|
38
|
+
groups you can use to spec the different Rails components
|
39
|
+
|
40
|
+
See Spec::Rails::Matchers for information about Rails-specific
|
41
|
+
expectations you can set on responses and models, etc.
|
42
|
+
|
43
|
+
== INSTALL
|
44
|
+
|
45
|
+
* Visit http://wiki.github.com/dchelimsky/rspec/rails for installation instructions.
|
data/Rakefile
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
gem 'hoe', '>=1.9.0'
|
3
|
+
require 'hoe'
|
4
|
+
require './lib/spec/rails/version'
|
5
|
+
require 'cucumber/rake/task'
|
6
|
+
|
7
|
+
$:.unshift(File.join(File.dirname(__FILE__), "/../rspec/lib"))
|
8
|
+
|
9
|
+
require 'spec/rake/spectask'
|
10
|
+
|
11
|
+
$hoe = Hoe.new('rspec-rails', Spec::Rails::VERSION::STRING) do |p|
|
12
|
+
p.summary = Spec::Rails::VERSION::SUMMARY
|
13
|
+
p.description = "Behaviour Driven Development for Ruby on Rails."
|
14
|
+
p.rubyforge_name = 'rspec'
|
15
|
+
p.developer('RSpec Development Team', 'rspec-devel@rubyforge.org')
|
16
|
+
p.extra_deps = [["rspec","1.2.2"],["rack",">=0.4.0"]]
|
17
|
+
p.extra_dev_deps = [["cucumber",">= 0.1.16"]]
|
18
|
+
p.remote_rdoc_dir = "rspec-rails/#{Spec::Rails::VERSION::STRING}"
|
19
|
+
p.history_file = 'History.rdoc'
|
20
|
+
p.readme_file = 'README.rdoc'
|
21
|
+
p.post_install_message = <<-POST_INSTALL_MESSAGE
|
22
|
+
#{'*'*50}
|
23
|
+
|
24
|
+
Thank you for installing rspec-rails-#{Spec::Rails::VERSION::STRING}
|
25
|
+
|
26
|
+
If you are upgrading, do this in each of your rails apps
|
27
|
+
that you want to upgrade:
|
28
|
+
|
29
|
+
$ ruby script/generate rspec
|
30
|
+
|
31
|
+
Please be sure to read History.rdoc and Upgrade.rdoc
|
32
|
+
for useful information about this release.
|
33
|
+
|
34
|
+
#{'*'*50}
|
35
|
+
POST_INSTALL_MESSAGE
|
36
|
+
end
|
37
|
+
|
38
|
+
['audit','test','test_deps','default','post_blog', 'release'].each do |task|
|
39
|
+
Rake.application.instance_variable_get('@tasks').delete(task)
|
40
|
+
end
|
41
|
+
|
42
|
+
task :post_blog do
|
43
|
+
# no-op
|
44
|
+
end
|
45
|
+
|
46
|
+
task :release => [:clean, :package] do |t|
|
47
|
+
version = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
|
48
|
+
abort "Versions don't match #{version} vs #{Spec::Rails::VERSION::STRING}" unless version == Spec::Rails::VERSION::STRING
|
49
|
+
pkg = "pkg/rspec-rails-#{version}"
|
50
|
+
|
51
|
+
rubyforge = RubyForge.new.configure
|
52
|
+
puts "Logging in to rubyforge ..."
|
53
|
+
rubyforge.login
|
54
|
+
|
55
|
+
puts "Releasing rspec-rails version #{version} ..."
|
56
|
+
["#{pkg}.gem", "#{pkg}.tgz"].each do |file|
|
57
|
+
rubyforge.add_file('rspec', 'rspec', Spec::Rails::VERSION::STRING, file)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
Spec::Rake::SpecTask.new
|
62
|
+
|
63
|
+
Cucumber::Rake::Task.new
|
64
|
+
|
65
|
+
task :default => [:features]
|
66
|
+
|
67
|
+
namespace :update do
|
68
|
+
desc "update the manfest"
|
69
|
+
task :manifest do
|
70
|
+
system %q[touch Manifest.txt; rake check_manifest | grep -v "(in " | patch]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
namespace :gemspec do
|
75
|
+
desc 'Refresh cucumber.gemspec to include ALL files'
|
76
|
+
task :refresh => 'update:manifest' do
|
77
|
+
File.open('rspec-rails.gemspec', 'w') {|io| io.write($hoe.spec.to_ruby)}
|
78
|
+
end
|
79
|
+
end
|
data/TODO.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* delegate params_from to assert_recognizes
|
data/Upgrade.rdoc
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
= Upgrade to 1.2
|
2
|
+
|
3
|
+
== What's changed
|
4
|
+
|
5
|
+
=== Supported Rails Versions
|
6
|
+
|
7
|
+
This release supports the following versions of rails:
|
8
|
+
|
9
|
+
* 2.0.5
|
10
|
+
* 2.1.2
|
11
|
+
* 2.2.2
|
12
|
+
* 2.3.1
|
13
|
+
|
14
|
+
=== update generated files
|
15
|
+
|
16
|
+
Be sure to run "script/generate rspec" and allow the following files to be overwritten:
|
17
|
+
|
18
|
+
* lib/tasks/rspec.rake
|
19
|
+
* script/spec
|
20
|
+
* script/spec_server
|
21
|
+
|
22
|
+
=== controller.use_rails_error_handling! is deprecated
|
23
|
+
|
24
|
+
Use <tt>rescue_action_in_public!</tt> instead. It comes directly from rails and does
|
25
|
+
exactly the same thing
|
26
|
+
|
27
|
+
=== route_for
|
28
|
+
|
29
|
+
After a change to edge rails broke our monkey-patched <tt>route_for</tt> method, I
|
30
|
+
decided to just delegate to rails' <tt>assert_generates</tt> method. For most cases,
|
31
|
+
this will not present a problem, but for some it might. You'll know if you
|
32
|
+
upgrade and see any newly failing, route-related examples. Here are the things
|
33
|
+
that you might need to change.
|
34
|
+
|
35
|
+
==== Make sure IDs are strings
|
36
|
+
|
37
|
+
If you had :id => 1 before, you need to change that to :id => "1"
|
38
|
+
|
39
|
+
#old
|
40
|
+
route_for(:controller => 'things', :action => 'show', :id => 1).should == "/things/1"
|
41
|
+
|
42
|
+
#new
|
43
|
+
route_for(:controller => 'things', :action => 'show', :id => "1").should == "/things/1"
|
44
|
+
|
45
|
+
==== Convert paths for non-get methods to hashes
|
46
|
+
|
47
|
+
If you had an example with a route that requires post, put, or delete, you'll
|
48
|
+
need to declare that explicitly.
|
49
|
+
|
50
|
+
#old
|
51
|
+
route_for(:controller => 'things', :action => 'create').should == "/things"
|
52
|
+
|
53
|
+
#new
|
54
|
+
route_for(:controller => 'things', :action => 'create').should == {:path => "/things", :method => :post}
|
55
|
+
|
56
|
+
=== Controller/template isolation
|
57
|
+
|
58
|
+
Even though controller specs do not render views by default (use
|
59
|
+
<tt>integrate_views</tt> to get them to render views), the way this works has
|
60
|
+
changed in this version.
|
61
|
+
|
62
|
+
It used to be that the view template need not even exist, but due to changes
|
63
|
+
in rails it became much more difficult to manage that for all the different
|
64
|
+
versions of rails that rspec-rails supports. So now the template must exist,
|
65
|
+
but it still won't be rendered unless you declare <tt>integrate_views</tt>.
|
66
|
+
|
67
|
+
== What's new
|
68
|
+
|
69
|
+
=== render no longer requires a path
|
70
|
+
|
71
|
+
The <tt>render()</tt> method in view specs will infer the path from the
|
72
|
+
first argument passed to <tt>describe()</tt>.
|
73
|
+
|
74
|
+
describe "players/show" do
|
75
|
+
it "does something" do
|
76
|
+
render
|
77
|
+
response.should have_tag("....")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
=== routing specs live in spec/routing
|
82
|
+
|
83
|
+
<tt>script/generate rspec_scaffold</tt> now generates its routing spec in
|
84
|
+
<tt>spec/routing/</tt>.
|
85
|
+
|
86
|
+
=== bypass_rescue
|
87
|
+
|
88
|
+
Added a new <tt>bypass_rescue()</tt> declaration for controller specs. Use this
|
89
|
+
when you want to specify that an error is raised by an action, even if that
|
90
|
+
error is later captured by a <tt>rescue_from()</tt> declaration.
|
91
|
+
|
92
|
+
describe AccountController do
|
93
|
+
describe "GET @account" do
|
94
|
+
context "requested by anonymous user" do
|
95
|
+
it "denies access" do
|
96
|
+
bypass_rescue
|
97
|
+
lambda do
|
98
|
+
get :show, :id => "37"
|
99
|
+
end.should raise_error(AccessDenied)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Sets up the Rails environment for Cucumber
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../../config/environment')
|
4
|
+
require 'cucumber/rails/world'
|
5
|
+
Cucumber::Rails.use_transactional_fixtures
|
6
|
+
|
7
|
+
# require 'webrat/rails'
|
8
|
+
|
9
|
+
# Comment out the next two lines if you're not using RSpec's matchers (should / should_not) in your steps.
|
10
|
+
require 'cucumber/rails/rspec'
|
11
|
+
# require 'webrat/rspec-rails'
|
12
|
+
|
13
|
+
require File.join(File.dirname(__FILE__), "/../../spec/resources/models/person")
|