mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:17:45 +08:00
Add deleted_by
to Trashable
tables
This commit is contained in:
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user