diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 09:52:54 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-01-27 09:52:54 -0700 |
commit | aac9da257f291ad8d2d4f914528881c240848bb2 (patch) | |
tree | 4ba06fbdc5f8f2d2a533abc7e7b3c0f14ad5d1aa /test/test_select_manager.rb | |
parent | d36a769234911c8374e09069eb054d4c60eb1b99 (diff) | |
download | rails-aac9da257f291ad8d2d4f914528881c240848bb2.tar.gz rails-aac9da257f291ad8d2d4f914528881c240848bb2.tar.bz2 rails-aac9da257f291ad8d2d4f914528881c240848bb2.zip |
Change the interface of `having` to match that of `where`
These two clauses have nearly identical semantics with regards to how
they would be constructed as an AST. It doesn't make sense for their
interfaces to be separate.
Diffstat (limited to 'test/test_select_manager.rb')
-rw-r--r-- | test/test_select_manager.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index 809f0de8df..7192027df4 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -111,22 +111,22 @@ module Arel it 'converts strings to SQLLiterals' do table = Table.new :users mgr = table.from - mgr.having 'foo' + mgr.having Arel.sql('foo') mgr.to_sql.must_be_like %{ SELECT FROM "users" HAVING foo } end it 'can have multiple items specified separately' do table = Table.new :users mgr = table.from - mgr.having 'foo' - mgr.having 'bar' + mgr.having Arel.sql('foo') + mgr.having Arel.sql('bar') mgr.to_sql.must_be_like %{ SELECT FROM "users" HAVING foo AND bar } end - it 'can have multiple items specified together' do + it 'can receive any node' do table = Table.new :users mgr = table.from - mgr.having 'foo', 'bar' + mgr.having Arel::Nodes::And.new([Arel.sql('foo'), Arel.sql('bar')]) mgr.to_sql.must_be_like %{ SELECT FROM "users" HAVING foo AND bar } end end |