From f2e976883615dddbde74e493c400eb17a8f79e34 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 2 Apr 2014 21:42:36 +0000 Subject: [PATCH] Avoid randomness on tests --- test/unit/profile_test.rb | 2 +- test/unit/uploaded_file_test.rb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/unit/profile_test.rb b/test/unit/profile_test.rb index d8d98ab..bf97b5b 100644 --- a/test/unit/profile_test.rb +++ b/test/unit/profile_test.rb @@ -363,7 +363,7 @@ class ProfileTest < ActiveSupport::TestCase t2 = c.tasks.build; t2.save!; t2.finish t3 = c.tasks.build; t3.save!; t3.finish - assert_equal [t2, t3], c.tasks.finished + assert_equivalent [t2, t3], c.tasks.finished end should 'responds to categories' do diff --git a/test/unit/uploaded_file_test.rb b/test/unit/uploaded_file_test.rb index 9392cd2..cea7605 100644 --- a/test/unit/uploaded_file_test.rb +++ b/test/unit/uploaded_file_test.rb @@ -324,13 +324,11 @@ class UploadedFileTest < ActiveSupport::TestCase should 'group trackers activity of image\'s upload' do ActionTracker::Record.delete_all gallery = fast_create(Gallery, :profile_id => profile.id) - count = ActionTracker::Record.find_all_by_verb('upload_image').count image1 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/rails.png', 'image/png'), :parent => gallery, :profile => profile) - count += 1 - assert_equal count, ActionTracker::Record.find_all_by_verb('upload_image').count + assert_equal 1, ActionTracker::Record.find_all_by_verb('upload_image').count image2 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/other-pic.jpg', 'image/jpg'), :parent => gallery, :profile => profile) - assert_equal count, ActionTracker::Record.find_all_by_verb('upload_image').count + assert_equal 1, ActionTracker::Record.find_all_by_verb('upload_image').count end { -- libgit2 0.21.2