diff options
Diffstat (limited to 'spec/arel')
-rw-r--r-- | spec/arel/visitors/oracle_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/arel/visitors/oracle_spec.rb b/spec/arel/visitors/oracle_spec.rb index 384725b788..87a1c378ac 100644 --- a/spec/arel/visitors/oracle_spec.rb +++ b/spec/arel/visitors/oracle_spec.rb @@ -15,6 +15,16 @@ module Arel sql = @visitor.accept stmt sql.should be_like %{ SELECT WHERE ROWNUM <= 10 } end + + it 'creates a subquery when there is order_by' do + stmt = Nodes::SelectStatement.new + stmt.orders << Nodes::SqlLiteral.new('foo') + stmt.limit = 10 + sql = @visitor.accept stmt + sql.should be_like %{ + SELECT * FROM (SELECT ORDER BY foo) WHERE ROWNUM <= 10 + } + end end end end |