From 7a758f7be9896073065f687b6f68e3f49b268aed Mon Sep 17 00:00:00 2001 From: wilkie Date: Fri, 10 Feb 2012 13:39:43 -0500 Subject: [PATCH] Fixed a user browse ordering test that was not actually valid. Authors are sorted by date, therefore we must craft the dates on the authors. It worked before since the Users were being created in the correct order, but I figure mine actually stresses the right thing. --- test/acceptance/user_browse_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/acceptance/user_browse_test.rb b/test/acceptance/user_browse_test.rb index a820ddd3..730023fd 100644 --- a/test/acceptance/user_browse_test.rb +++ b/test/acceptance/user_browse_test.rb @@ -16,8 +16,11 @@ describe "sorted by creation date (default)" do it "sorts by latest users by default" do - aardvark = Fabricate(:user, :username => "aardvark", :created_at => Date.new(2010, 10, 23)) - zebra = Fabricate(:user, :username => "zebra", :created_at => Date.new(2011, 10, 24)) + zebra = Fabricate(:user, :username => "zebra") + zebra.author.created_at = Date.new(2010, 10, 24) + + aardvark = Fabricate(:user, :username => "aardvark") + aardvark.author.created_at = Date.new(2010, 10, 23) visit "/users" assert_match /zebra.*aardvark/m, page.body