Created
August 13, 2013 14:25
-
-
Save andoneve/6221602 to your computer and use it in GitHub Desktop.
This file contains 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
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