Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created February 3, 2009 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save josevalim/57644 to your computer and use it in GitHub Desktop.
Save josevalim/57644 to your computer and use it in GitHub Desktop.
describe ProjectsController do
describe "responding to GET show" do
receives :find, :on => Project, :with => { :id => '37' }, :and_returns => mock_project
get :show, :id => '37'
should_assign_to(:project)
describe "mime XML" do
mime Mime::XML
#
end
end
describe "responding to DELETE destroy" do
receives :find, :on => Project, :with => { :id => '37' }, :and_returns => mock_project
receives :destroy, :on => mock_project, :and_returns => true
delete :destroy, :id => '37'
should_assign_to(:project)
should_redirect_to { projects_url }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment