Commit 22359d1515b3ec83409a7f5c0fe66380c62072f0

Authored by Rodrigo Souto
1 parent bd1870c9

[postgres-tests] Fixing tasks tests

Showing 1 changed file with 4 additions and 4 deletions   Show diff stats
test/unit/task_test.rb
@@ -324,10 +324,10 @@ class TaskTest < ActiveSupport::TestCase @@ -324,10 +324,10 @@ class TaskTest < ActiveSupport::TestCase
324 324
325 should 'order tasks by some attribute correctly' do 325 should 'order tasks by some attribute correctly' do
326 Task.destroy_all 326 Task.destroy_all
327 - t1 = fast_create(Task, :status => 4, :created_at => 1)  
328 - t2 = fast_create(Task, :status => 3, :created_at => 2)  
329 - t3 = fast_create(Task, :status => 2, :created_at => 3)  
330 - t4 = fast_create(Task, :status => 1, :created_at => 4) 327 + t1 = fast_create(Task, :status => 4, :created_at => Time.now + 1.hour)
  328 + t2 = fast_create(Task, :status => 3, :created_at => Time.now + 2.hour)
  329 + t3 = fast_create(Task, :status => 2, :created_at => Time.now + 3.hour)
  330 + t4 = fast_create(Task, :status => 1, :created_at => Time.now + 4.hour)
331 331
332 assert_equal [t1,t2,t3,t4], Task.order_by('created_at', 'asc') 332 assert_equal [t1,t2,t3,t4], Task.order_by('created_at', 'asc')
333 assert_equal [t4,t3,t2,t1], Task.order_by('created_at', 'desc') 333 assert_equal [t4,t3,t2,t1], Task.order_by('created_at', 'desc')