Commit 8d58c8421739b9cf33a7c4f0eed72e9bae32151f

Authored by Rodrigo Souto
1 parent 40da5e3b

organization-test: fix action_tracker creation

Showing 1 changed file with 6 additions and 7 deletions   Show diff stats
test/unit/organization_test.rb
... ... @@ -353,18 +353,17 @@ class OrganizationTest < ActiveSupport::TestCase
353 353  
354 354 should 'find more active organizations' do
355 355 person = fast_create(Person)
356   - Organization.destroy_all
357 356 p1 = fast_create(Organization)
358 357 p2 = fast_create(Organization)
359 358 p3 = fast_create(Organization)
360 359  
361 360 ActionTracker::Record.destroy_all
362   - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person, :created_at => Time.now, :target_id => p1.id)
363   - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person, :created_at => Time.now, :target_id => p2.id)
364   - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person, :created_at => Time.now, :target_id => p2.id)
365   - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person, :created_at => Time.now, :target_id => p3.id)
366   - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person, :created_at => Time.now, :target_id => p3.id)
367   - fast_create(ActionTracker::Record, :user_type => 'Profile', :user_id => person, :created_at => Time.now, :target_id => p3.id)
  361 + ActionTracker::Record.create!(:user => person, :target => p1, :verb => 'leave_scrap')
  362 + ActionTracker::Record.create!(:user => person, :target => p2, :verb => 'leave_scrap')
  363 + ActionTracker::Record.create!(:user => person, :target => p2, :verb => 'leave_scrap')
  364 + ActionTracker::Record.create!(:user => person, :target => p3, :verb => 'leave_scrap')
  365 + ActionTracker::Record.create!(:user => person, :target => p3, :verb => 'leave_scrap')
  366 + ActionTracker::Record.create!(:user => person, :target => p3, :verb => 'leave_scrap')
368 367  
369 368 assert_order [p3,p2,p1] , Organization.more_active
370 369 end
... ...