diff options
Diffstat (limited to 'test/visitors/test_postgres.rb')
-rw-r--r-- | test/visitors/test_postgres.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/visitors/test_postgres.rb b/test/visitors/test_postgres.rb index 74446c23ba..446eae0c4a 100644 --- a/test/visitors/test_postgres.rb +++ b/test/visitors/test_postgres.rb @@ -32,6 +32,17 @@ module Arel assert_equal 1, sql.scan(/LIMIT/).length, 'should have one limit' end + it 'should support DISTINCT ON' do + core = Arel::Nodes::SelectCore.new + core.set_quantifier = Arel::Nodes::DistinctOn.new(Arel.sql('aaron')) + assert_match 'DISTINCT ON ( aaron )', @visitor.accept(core) + end + + it 'should support DISTINCT' do + core = Arel::Nodes::SelectCore.new + core.set_quantifier = Arel::Nodes::Distinct.new + assert_equal 'SELECT DISTINCT', @visitor.accept(core) + end end end end |