mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:41:24 +08:00
Can recover deleted topics. Deleted topics show the first post as deleted in the UI.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user