Add deleted_by to Trashable tables

This commit is contained in:
Robin Ward
2013-07-09 15:20:18 -04:00
parent 4c0fe3bc12
commit b7327942af
18 changed files with 62 additions and 38 deletions

View File

@ -29,7 +29,7 @@ describe InvitesController do
end
it "destroys the invite" do
Invite.any_instance.expects(:trash!)
Invite.any_instance.expects(:trash!).with(user)
delete :destroy, email: invite.email
end

View File

@ -137,7 +137,7 @@ describe PostActionsController do
end
it "works with a deleted post" do
flagged_post.trash!
flagged_post.trash!(user)
xhr :post, :clear_flags, id: flagged_post.id, post_action_type_id: PostActionType.types[:spam]
response.should be_success
end

View File

@ -14,7 +14,8 @@ describe PostsController do
describe 'show' do
let(:post) { Fabricate(:post, user: log_in) }
let(:user) { log_in }
let(:post) { Fabricate(:post, user: user) }
it 'ensures the user can see the post' do
Guardian.any_instance.expects(:can_see?).with(post).returns(false)
@ -30,7 +31,7 @@ describe PostsController do
context "deleted post" do
before do
post.trash!
post.trash!(user)
end
it "can't find deleted posts as an anonymous user" do