diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-12-29 11:09:10 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-29 11:09:10 -0700 |
commit | 848cba13bd8a1fd7445458160a15dbf175c4c61d (patch) | |
tree | 3e19b0aac2f0e1e75b5da2faa9c5c63731e59d99 /activerecord/test/cases | |
parent | fb6df2ac46a82f02a6a620953e04cd834bc7f887 (diff) | |
download | rails-848cba13bd8a1fd7445458160a15dbf175c4c61d.tar.gz rails-848cba13bd8a1fd7445458160a15dbf175c4c61d.tar.bz2 rails-848cba13bd8a1fd7445458160a15dbf175c4c61d.zip |
Fix failing tests
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/relation/where_chain_test.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/activerecord/test/cases/relation/where_chain_test.rb b/activerecord/test/cases/relation/where_chain_test.rb index 24f6f1d2ab..619055f1e7 100644 --- a/activerecord/test/cases/relation/where_chain_test.rb +++ b/activerecord/test/cases/relation/where_chain_test.rb @@ -24,7 +24,7 @@ module ActiveRecord end def test_not_null - expected = Post.arel_table[@name].not_eq(Arel::Nodes::Quoted.new(nil)) + expected = Post.arel_table[@name].not_eq(nil) relation = Post.where.not(title: nil) assert_equal([expected], relation.where_values) end @@ -36,14 +36,13 @@ module ActiveRecord end def test_not_in - values = %w[hello goodbye].map { |v| Arel::Nodes::Quoted.new(v) } - expected = Post.arel_table[@name].not_in(values) + expected = Post.arel_table[@name].not_in(%w[hello goodbye]) relation = Post.where.not(title: %w[hello goodbye]) assert_equal([expected], relation.where_values) end def test_association_not_eq - expected = Comment.arel_table[@name].not_eq(Arel::Nodes::Quoted.new('hello')) + expected = Comment.arel_table[@name].not_eq('hello') relation = Post.joins(:comments).where.not(comments: {title: 'hello'}) assert_equal(expected.to_sql, relation.where_values.first.to_sql) end @@ -91,10 +90,7 @@ module ActiveRecord def test_chaining_multiple relation = Post.where.not(author_id: [1, 2]).where.not(title: 'ruby on rails') - expected = Post.arel_table['author_id'].not_in([ - Arel::Nodes::Quoted.new(1), - Arel::Nodes::Quoted.new(2), - ]) + expected = Post.arel_table['author_id'].not_in([1, 2]) assert_equal(expected, relation.where_values[0]) value = relation.where_values[1] |