Plugins - RSpec Response Enhancer

StarAdd to favorites

RspecResponseEnhancer

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

Michael Grosser

http://small-plugins.googlecode.com/

http://small-plugins.googlecode.com/svn/trunk/rspec_response_enhancer/

Rails' (MIT)

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Testing

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?