Logo: Relish

  1. Sign up
  2. Sign in

Project: RSpec Rails 2.9


rspec-rails offers a number of custom matchers, most of which are
rspec-compatible wrappers for Rails' assertions.


# delegates to assert_redirected_to
response.should redirect_to(path)


# delegates to assert_template
response.should render_template(template_name)

assigned objects

# passes if assigns(:widget) is an instance of Widget
# and it is not persisted
assigns(:widget).should be_a_new(Widget)


  1. be_a_new matcher
  2. render_template matcher
  3. redirect_to matcher
  4. ActiveRecord::Relation match array

Last published about 1 month ago by dchelimsky.