FIX: specs for ruby 2.0.0-p247

This commit is contained in:
Régis Hanol 2013-08-20 21:45:58 +02:00
parent 3abeb5f793
commit 3922c9b6b5
2 changed files with 6 additions and 3 deletions

View file

@ -191,10 +191,11 @@ describe TopicView do
context '#recent_posts' do context '#recent_posts' do
before do before do
24.times do # our let()s have already created 3 24.times do |t| # our let()s have already created 3
Fabricate(:post, topic: topic, user: first_poster) Fabricate(:post, topic: topic, user: first_poster, created_at: t.seconds.from_now)
end end
end end
it 'returns at most 25 recent posts ordered newest first' do it 'returns at most 25 recent posts ordered newest first' do
recent_posts = topic_view.recent_posts recent_posts = topic_view.recent_posts

View file

@ -39,7 +39,9 @@ describe Post do
describe '#by_newest' do describe '#by_newest' do
it 'returns posts ordered by created_at desc' do it 'returns posts ordered by created_at desc' do
2.times { Fabricate(:post) } 2.times do |t|
Fabricate(:post, created_at: t.seconds.from_now)
end
Post.by_newest.first.created_at.should > Post.by_newest.last.created_at Post.by_newest.first.created_at.should > Post.by_newest.last.created_at
end end
end end