-
-
Save justinko/1043913 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 | |
describe "PUT #update" do | |
let(:post) { Factory(:post) } | |
before do | |
login_as user | |
put :update, :id => post.id, :body => "new content" | |
end | |
context "logged in as post's author" do | |
let(:user) { post.author } | |
its(:response) { should be_success } | |
end | |
context "logged in as another user" do | |
let(:user) { Factory(:user) } | |
its(: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