deleting posts as an admin was bust

This commit is contained in:
Sam
2013-05-03 17:56:23 +10:00
parent 42494b5bb1
commit 3eab0be4a8
3 changed files with 16 additions and 5 deletions

View File

@ -9,6 +9,7 @@ describe PostDestroyer do
describe 'basic destroying' do
let(:moderator) { Fabricate(:moderator) }
let(:admin) { Fabricate(:admin) }
context "as the creator of the post" do
before do
@ -38,6 +39,16 @@ describe PostDestroyer do
post.deleted_at.should be_present
end
end
context "as an admin" do
before do
PostDestroyer.new(admin, post).destroy
end
it "deletes the post" do
post.deleted_at.should be_present
end
end
end