Can recover deleted topics. Deleted topics show the first post as deleted in the UI.

This commit is contained in:
Robin Ward
2013-07-12 12:08:23 -04:00
parent f05bc44fbe
commit 6ca5df0a09
16 changed files with 167 additions and 31 deletions

View File

@ -410,6 +410,25 @@ describe Guardian do
end
end
describe "can_recover_topic?" do
it "returns false for a nil user" do
Guardian.new(nil).can_recover_topic?(topic).should be_false
end
it "returns false for a nil object" do
Guardian.new(user).can_recover_topic?(nil).should be_false
end
it "returns false for a regular user" do
Guardian.new(user).can_recover_topic?(topic).should be_false
end
it "returns true for a moderator" do
Guardian.new(moderator).can_recover_topic?(topic).should be_true
end
end
describe "can_recover_post?" do
it "returns false for a nil user" do
@ -622,6 +641,7 @@ describe Guardian do
context 'can_delete?' do
it 'returns false with a nil object' do