mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add ?status=deleted querystring
Add tests around the ?status=deleted querystring
This commit is contained in:
@@ -40,6 +40,17 @@ describe TopicQuery do
|
||||
|
||||
end
|
||||
|
||||
context 'deleted filter' do
|
||||
it "filters deleted topics correctly" do
|
||||
topic = Fabricate(:topic, deleted_at: 1.year.ago)
|
||||
|
||||
TopicQuery.new(admin, status: 'deleted').list_latest.topics.size.should == 1
|
||||
TopicQuery.new(moderator, status: 'deleted').list_latest.topics.size.should == 1
|
||||
TopicQuery.new(user, status: 'deleted').list_latest.topics.size.should == 0
|
||||
TopicQuery.new(nil, status: 'deleted').list_latest.topics.size.should == 0
|
||||
end
|
||||
end
|
||||
|
||||
context 'category filter' do
|
||||
let(:category) { Fabricate(:category) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user