aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors
diff options
context:
space:
mode:
Diffstat (limited to 'test/visitors')
-rw-r--r--test/visitors/test_oracle.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/visitors/test_oracle.rb b/test/visitors/test_oracle.rb
index 9111a266cf..29d7042084 100644
--- a/test/visitors/test_oracle.rb
+++ b/test/visitors/test_oracle.rb
@@ -87,6 +87,16 @@ module Arel
}
end
+ it 'creates a subquery when there is group by' do
+ stmt = Nodes::SelectStatement.new
+ stmt.cores.first.groups << Nodes::SqlLiteral.new('foo')
+ stmt.limit = Nodes::Limit.new(10)
+ sql = compile stmt
+ sql.must_be_like %{
+ SELECT * FROM (SELECT GROUP BY foo ) WHERE ROWNUM <= 10
+ }
+ end
+
it 'creates a subquery when there is DISTINCT' do
stmt = Nodes::SelectStatement.new
stmt.cores.first.set_quantifier = Arel::Nodes::Distinct.new