Created
June 25, 2011 11:27
-
-
Save dchelimsky/1046386 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe PostsController do | |
let(:post) { Factory(:post) } | |
describe "PUT #update" do | |
it "allows an author to edit a post" do | |
sign_in post.author | |
put :update, :id => post.id | |
response.should be_successful | |
end | |
it "does not allow a non-author to edit a post" do | |
sign_in Factory(:user, :email => "[email protected]") | |
put :update, :id => post.id | |
response.should be_forbidden | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment