Skip to content

Instantly share code, notes, and snippets.

@jferris
Created August 5, 2009 21:34
Show Gist options
  • Select an option

  • Save jferris/162986 to your computer and use it in GitHub Desktop.

Select an option

Save jferris/162986 to your computer and use it in GitHub Desktop.
describe PostsController, "on GET show" do
before(:each) do
@post = stub('a post', :to_param => '1')
Post.expects(:find).with(@post.to_param).returns(@post)
get :show, :id => @post.to_param
end
it { should render_template(:show) }
it { should assign_to(:post).with(@post) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment