FEATURE: Add ?status=deleted querystring

Add tests around the ?status=deleted querystring
This commit is contained in:
cpradio
2014-11-19 17:46:55 -05:00
parent 22fa46b1f2
commit 0d6e5470d4
2 changed files with 20 additions and 1 deletions

View File

@@ -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) }