Created
August 5, 2009 21:36
-
-
Save jferris/162987 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe PostsController, "on GET show" do | |
before(:each) do | |
@post = stub('a post', :to_param => '1') | |
Post.stubs(:find => @post) | |
get :show, :id => @post.to_param | |
end | |
it { should render_template(:show) } | |
it "should find and assign the given post" do | |
Post.should have_received(:find).with(@post.to_param) | |
should assign_to(:post).with(@post) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment