Commit c9e6851d0ae50a2e8c533dd1d5f11da396b61325
1 parent
5a265683
Exists in
master
and in
20 other branches
rails4: do not assert ActiveRecord::Relation as rails changes it
Showing
3 changed files
with
4 additions
and
7 deletions
Show diff stats
test/unit/organization_test.rb
... | ... | @@ -130,7 +130,7 @@ class OrganizationTest < ActiveSupport::TestCase |
130 | 130 | |
131 | 131 | should 'list pending enterprise validations' do |
132 | 132 | org = Organization.new |
133 | - assert_kind_of ActiveRecord::Relation, org.pending_validations | |
133 | + assert org.pending_validations.empty? | |
134 | 134 | end |
135 | 135 | |
136 | 136 | should 'be able to find a pending validation by its code' do |
... | ... | @@ -148,7 +148,7 @@ class OrganizationTest < ActiveSupport::TestCase |
148 | 148 | |
149 | 149 | should 'be able to find already processed validations' do |
150 | 150 | org = Organization.new |
151 | - assert_kind_of ActiveRecord::Relation, org.processed_validations | |
151 | + assert org.processed_validations.empty? | |
152 | 152 | end |
153 | 153 | |
154 | 154 | should 'be able to find an already processed validation by its code' do |
... | ... | @@ -188,7 +188,7 @@ class OrganizationTest < ActiveSupport::TestCase |
188 | 188 | org.foundation_year = 20.07 |
189 | 189 | org.valid? |
190 | 190 | assert org.errors[:foundation_year.to_s].present? |
191 | - | |
191 | + | |
192 | 192 | org.foundation_year = 2007 |
193 | 193 | org.valid? |
194 | 194 | assert ! org.errors[:foundation_year.to_s].present? |
... | ... | @@ -208,7 +208,7 @@ class OrganizationTest < ActiveSupport::TestCase |
208 | 208 | |
209 | 209 | assert o.members.include?(p), "Organization should add the new member" |
210 | 210 | end |
211 | - | |
211 | + | |
212 | 212 | should 'allow to remove members' do |
213 | 213 | c = fast_create(Organization) |
214 | 214 | p = create_user('myothertestuser').person | ... | ... |
test/unit/person_test.rb
... | ... | @@ -1346,14 +1346,12 @@ class PersonTest < ActiveSupport::TestCase |
1346 | 1346 | |
1347 | 1347 | abusers = Person.abusers |
1348 | 1348 | |
1349 | - assert_equal ActiveRecord::Relation, abusers.class | |
1350 | 1349 | assert_includes abusers, abuser1 |
1351 | 1350 | assert_includes abusers, abuser2 |
1352 | 1351 | assert_not_includes abusers, person |
1353 | 1352 | |
1354 | 1353 | non_abusers = Person.non_abusers |
1355 | 1354 | |
1356 | - assert_equal ActiveRecord::Relation, non_abusers.class | |
1357 | 1355 | assert_not_includes non_abusers, abuser1 |
1358 | 1356 | assert_not_includes non_abusers, abuser2 |
1359 | 1357 | assert_includes non_abusers, person | ... | ... |
test/unit/product_category_test.rb