diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 10:30:38 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 10:30:38 -0700 |
commit | d26dd00854c783bcb1249168bb3f4adf9f99be6c (patch) | |
tree | af9cfb9f93d4d66689a19b359bba1625d629350c /activerecord/test/cases/scoping/relation_scoping_test.rb | |
parent | c2c95cd279c988e7bd94008264e956e30b78c9ec (diff) | |
download | rails-d26dd00854c783bcb1249168bb3f4adf9f99be6c.tar.gz rails-d26dd00854c783bcb1249168bb3f4adf9f99be6c.tar.bz2 rails-d26dd00854c783bcb1249168bb3f4adf9f99be6c.zip |
`WhereClause#predicates` does not need to be public
The only place it was accessed was in tests. Many of them have another
way that they can test their behavior, that doesn't involve reaching
into internals as far as they did. `AssociationScopeTest` is testing a
situation where the where clause would have one bind param per
predicate, so it can just ignore the predicates entirely. The where
chain test was primarly duplicating the logic tested on `WhereClause`
directly, so I instead just make sure it calls the appropriate method
which is fully tested in isolation.
Diffstat (limited to 'activerecord/test/cases/scoping/relation_scoping_test.rb')
-rw-r--r-- | activerecord/test/cases/scoping/relation_scoping_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/scoping/relation_scoping_test.rb b/activerecord/test/cases/scoping/relation_scoping_test.rb index 73760e628b..02b32abebf 100644 --- a/activerecord/test/cases/scoping/relation_scoping_test.rb +++ b/activerecord/test/cases/scoping/relation_scoping_test.rb @@ -184,7 +184,7 @@ class RelationScopingTest < ActiveRecord::TestCase rescue end - assert !Developer.all.where_clause.predicates.include?("name = 'Jamis'") + assert_not Developer.all.to_sql.include?("name = 'Jamis'"), "scope was not restored" end def test_default_scope_filters_on_joins |