From 17e3ecde92fb1ab56697d16cf3e827b395e3a471 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 26 Sep 2015 00:38:59 +0200 Subject: [PATCH] Fixed test. --- test/unit/assets_test.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/unit/assets_test.rb b/test/unit/assets_test.rb index 5eed1a28f..014057f81 100644 --- a/test/unit/assets_test.rb +++ b/test/unit/assets_test.rb @@ -247,7 +247,7 @@ class AssetsTest < ActiveSupport::TestCase attributes['password'] = '' attributes.delete('token_ids') attributes.delete('authorization_ids') - assert( !diff(attributes, assets[:User][user_new_2.id]), 'check assets' ) + assert( diff(attributes, assets[:User][user_new_2.id]), 'check assets' ) # check new assets lookup assets = org_new.assets({}) @@ -266,12 +266,14 @@ class AssetsTest < ActiveSupport::TestCase def diff(o1, o2) return true if o1 == o2 - if o1['updated_at'] - o1['updated_at'] = o1['updated_at'].to_s - end - if o2['updated_at'] - o2['updated_at'] = o2['updated_at'].to_s - end + %w(updated_at created_at).each {|item| + if o1[item] + o1[item] = o1[item].to_s + end + if o2[item] + o2[item] = o2[item].to_s + end + } return true if (o1.to_a - o2.to_a).empty? #puts "ERROR: difference \n1: #{o1.inspect}\n2: #{o2.inspect}\ndiff: #{(o1.to_a - o2.to_a).inspect}" false