Skip to content

Instantly share code, notes, and snippets.

@andoneve
Created August 13, 2013 14:25
Show Gist options
  • Save andoneve/6221602 to your computer and use it in GitHub Desktop.
Save andoneve/6221602 to your computer and use it in GitHub Desktop.
test "should destroy resource if user is admin" do
#given user is admin
u = User.create(:name => "nicole", :email => "nicole@me.com", :admin => true)
resource = Resource.create!(:id => "1", :title => "hi", :link => "http://hallo.com", :summary => "hi")
#when they click 'destroy resource'
delete :destroy, id: @resource.id
#then they destroy the resource
assert resource.link == nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment