From c9e6851d0ae50a2e8c533dd1d5f11da396b61325 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Sun, 5 Apr 2015 09:49:36 -0300 Subject: [PATCH] rails4: do not assert ActiveRecord::Relation as rails changes it --- test/unit/organization_test.rb | 8 ++++---- test/unit/person_test.rb | 2 -- test/unit/product_category_test.rb | 1 - 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test/unit/organization_test.rb b/test/unit/organization_test.rb index 5aab807..2cc605e 100644 --- a/test/unit/organization_test.rb +++ b/test/unit/organization_test.rb @@ -130,7 +130,7 @@ class OrganizationTest < ActiveSupport::TestCase should 'list pending enterprise validations' do org = Organization.new - assert_kind_of ActiveRecord::Relation, org.pending_validations + assert org.pending_validations.empty? end should 'be able to find a pending validation by its code' do @@ -148,7 +148,7 @@ class OrganizationTest < ActiveSupport::TestCase should 'be able to find already processed validations' do org = Organization.new - assert_kind_of ActiveRecord::Relation, org.processed_validations + assert org.processed_validations.empty? end should 'be able to find an already processed validation by its code' do @@ -188,7 +188,7 @@ class OrganizationTest < ActiveSupport::TestCase org.foundation_year = 20.07 org.valid? assert org.errors[:foundation_year.to_s].present? - + org.foundation_year = 2007 org.valid? assert ! org.errors[:foundation_year.to_s].present? @@ -208,7 +208,7 @@ class OrganizationTest < ActiveSupport::TestCase assert o.members.include?(p), "Organization should add the new member" end - + should 'allow to remove members' do c = fast_create(Organization) p = create_user('myothertestuser').person diff --git a/test/unit/person_test.rb b/test/unit/person_test.rb index afaa501..d8ed54e 100644 --- a/test/unit/person_test.rb +++ b/test/unit/person_test.rb @@ -1346,14 +1346,12 @@ class PersonTest < ActiveSupport::TestCase abusers = Person.abusers - assert_equal ActiveRecord::Relation, abusers.class assert_includes abusers, abuser1 assert_includes abusers, abuser2 assert_not_includes abusers, person non_abusers = Person.non_abusers - assert_equal ActiveRecord::Relation, non_abusers.class assert_not_includes non_abusers, abuser1 assert_not_includes non_abusers, abuser2 assert_includes non_abusers, person diff --git a/test/unit/product_category_test.rb b/test/unit/product_category_test.rb index ce5972b..b5bb8a8 100644 --- a/test/unit/product_category_test.rb +++ b/test/unit/product_category_test.rb @@ -53,7 +53,6 @@ class ProductCategoryTest < ActiveSupport::TestCase scope = ProductCategory.by_enterprise(enterprise) - assert_equal ActiveRecord::Relation, scope.class assert_equivalent [c1,c2], scope end -- libgit2 0.21.2