mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
Merge pull request #290 from alxndr/category-rss
RSS for topics in a category
This commit is contained in:
@ -1033,4 +1033,17 @@ describe Topic do
|
||||
|
||||
end
|
||||
|
||||
describe 'scopes' do
|
||||
describe '#by_most_recently_created' do
|
||||
it 'returns topics ordered by created_at desc, id desc' do
|
||||
now = Time.now
|
||||
a = Fabricate(:topic, created_at: now - 2.minutes)
|
||||
b = Fabricate(:topic, created_at: now)
|
||||
c = Fabricate(:topic, created_at: now)
|
||||
d = Fabricate(:topic, created_at: now - 2.minutes)
|
||||
Topic.by_newest.should == [c,b,d,a]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user