Merge pull request #1364 from ZogStriP/fix-specs-on-ruby-p247

FIX: specs for ruby 2.0.0-p247
This commit is contained in:
Jeff Atwood 2013-08-20 13:46:19 -07:00
commit 3d7e46b42a
2 changed files with 6 additions and 3 deletions

View file

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

View file

@ -39,7 +39,9 @@ describe Post do
describe '#by_newest' 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
end
end