aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_postgres.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-04-21 15:46:24 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2011-04-21 15:46:24 -0500
commit0b9af9762a5f3431f83a9bba6919fef9346e310a (patch)
tree7731a00a00ff0588835fe2e7f7164be0a4264116 /test/visitors/test_postgres.rb
parentcae83ce964b9919b890bb7fa6f920a536e6b5425 (diff)
downloadrails-0b9af9762a5f3431f83a9bba6919fef9346e310a.tar.gz
rails-0b9af9762a5f3431f83a9bba6919fef9346e310a.tar.bz2
rails-0b9af9762a5f3431f83a9bba6919fef9346e310a.zip
adding Distinct ON node
Diffstat (limited to 'test/visitors/test_postgres.rb')
-rw-r--r--test/visitors/test_postgres.rb11
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