This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
ActionController Helpers
Just like the ActiveRecord macros, Shoulda gives you a set of macros to make testing your controllers as clear as possible. All of these methods are in the Shoulda RDocs, but here’s a quick example:
class UsersControllerTest < Test::Unit::TestCase
context "on GET to :show" do
setup { get :show, :id => 1 }
should_assign_to :user
should_respond_with :success
should_render_template :show
should_not_set_the_flash
should "do something else really cool" do
assert_equal 1, assigns(:user).id
end
end
context "on POST to :create" do
setup { post :create, :user => {:name => 'Ronald', :party => 'Repukeulan' } }
should_assign_to :user
should_redirect_to("the new users page") { user_url(assigns :user) }
should_set_the_flash_to(/created/i)
end
end







