FEATURE: log topic/post deletions from staff members

This commit is contained in:
Régis Hanol
2014-10-01 17:40:13 +02:00
parent be93f224a6
commit 98b6b9821a
14 changed files with 155 additions and 33 deletions

View File

@@ -170,6 +170,12 @@ describe PostDestroyer do
author.reload
}.to change { author.post_count }.by(-1)
end
it "creates a new user history entry" do
expect {
PostDestroyer.new(moderator, post).destroy
}.to change { UserHistory.count}.by(1)
end
end
context "as an admin" do
@@ -258,6 +264,12 @@ describe PostDestroyer do
post.deleted_at.should be_present
post.deleted_by.should == admin
end
it "creates a new user history entry" do
expect {
PostDestroyer.new(admin, post).destroy
}.to change { UserHistory.count}.by(1)
end
end
end