diff --git a/test/unit/forum_helper_test.rb b/test/unit/forum_helper_test.rb index 1e4be5c..ff1c688 100644 --- a/test/unit/forum_helper_test.rb +++ b/test/unit/forum_helper_test.rb @@ -30,8 +30,9 @@ class ForumHelperTest < ActiveSupport::TestCase should 'list posts with different classes' do forum.children << older_post = TextileArticle.create!(:name => 'First post', :profile => profile, :parent => forum, :published => false) + one_month_later = Time.now + 1.month + Time.stubs(:now).returns(one_month_later) forum.children << newer_post = TextileArticle.create!(:name => 'Second post', :profile => profile, :parent => forum, :published => true) - older_post.updated_at = Time.now.ago(1.month); older_post.send(:update_without_callbacks) assert_match /forum-post position-1 first odd-post.*forum-post position-2 last not-published even-post/, list_forum_posts(forum.posts) end -- libgit2 0.21.2