Plugins - RSpec Response Enhancer
Add to favoritesRspecResponseEnhancer
In case of failure the normal should be_redirect and its friends are far from helpful…
expected redirect? to return true, got false expected "new", got nil
Now you can have this:
Status should be redirect but was 200(success)
- rendered addresses/new
- Flash:
:error = Address contains errors!
- Errors:Errors on @address(Address):
City can't be blank
Install
script/plugin install http://small-plugins.googlecode.com/svn/trunk/rspec_response_enhancer/
add to spec/spec_helper.rb: … require ‘rspec_response_enhancer’ …
Spec::Runner.configure do |config|
... config.include(RSpecResponseEnhancer) ...
end
Example
response.should have_succeeded response.should have_been_success
have_failed+have_been_error have_missed+have_been_missing have_redirected+have_been_redirect
response.should redirect_to / render_template as normal
Copyright © 2008 Michael Grosser, released under the MIT license
http://small-plugins.googlecode.com/
http://small-plugins.googlecode.com/svn/trunk/rspec_response_enhancer/
Rails' (MIT)
Testing
