Skip to content

Instantly share code, notes, and snippets.

@thoughtbot
Created August 4, 2009 22:28
Show Gist options
  • Save thoughtbot/162334 to your computer and use it in GitHub Desktop.
Save thoughtbot/162334 to your computer and use it in GitHub Desktop.
context "when signed out" do
setup { sign_out }
context "on get to new" do
setup { get :new }
should_deny_access
end
end
context "when signed in" do
setup { sign_in }
context "on get to new" do
setup { get :new }
...
end
end
context "when signed in as an admin" do
setup { sign_in_as Factory(:admin_user) }
context "on delete to destroy" do
setup { delete :destroy }
...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment