Skip to content

Commit

Permalink
Fixed a user browse ordering test that was not actually valid.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wilkie committed Feb 10, 2012
1 parent 952ae42 commit 7a758f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/acceptance/user_browse_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7a758f7

Please sign in to comment.