diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 13:39:56 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-03 13:39:56 -0800 |
commit | b035def39a8b4966fd33779bd5a2a9d0c9a33e66 (patch) | |
tree | 62c8553c08b117a6d11dba6d366ff46e10bf6026 /test | |
parent | 4acbe3864f5e5c4c8c70c5f58fbd5c09617d1662 (diff) | |
download | rails-b035def39a8b4966fd33779bd5a2a9d0c9a33e66.tar.gz rails-b035def39a8b4966fd33779bd5a2a9d0c9a33e66.tar.bz2 rails-b035def39a8b4966fd33779bd5a2a9d0c9a33e66.zip |
fixing tests for oracle visitor
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_oracle.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/visitors/test_oracle.rb b/test/visitors/test_oracle.rb index 2c9bba15d8..c6fcb7134c 100644 --- a/test/visitors/test_oracle.rb +++ b/test/visitors/test_oracle.rb @@ -59,7 +59,7 @@ module Arel describe 'limit' do it 'adds a rownum clause' do stmt = Nodes::SelectStatement.new - stmt.limit = 10 + stmt.limit = Nodes::Limit.new(10) sql = @visitor.accept stmt sql.must_be_like %{ SELECT WHERE ROWNUM <= 10 } end @@ -67,7 +67,7 @@ module Arel it 'is idempotent' do stmt = Nodes::SelectStatement.new stmt.orders << Nodes::SqlLiteral.new('foo') - stmt.limit = 10 + stmt.limit = Nodes::Limit.new(10) sql = @visitor.accept stmt sql2 = @visitor.accept stmt sql.must_equal sql2 @@ -76,7 +76,7 @@ module Arel it 'creates a subquery when there is order_by' do stmt = Nodes::SelectStatement.new stmt.orders << Nodes::SqlLiteral.new('foo') - stmt.limit = 10 + stmt.limit = Nodes::Limit.new(10) sql = @visitor.accept stmt sql.must_be_like %{ SELECT * FROM (SELECT ORDER BY foo) WHERE ROWNUM <= 10 @@ -86,7 +86,7 @@ module Arel it 'creates a subquery when there is DISTINCT' do stmt = Nodes::SelectStatement.new stmt.cores.first.projections << Nodes::SqlLiteral.new('DISTINCT id') - stmt.limit = 10 + stmt.limit = Arel::Nodes::Limit.new(10) sql = @visitor.accept stmt sql.must_be_like %{ SELECT * FROM (SELECT DISTINCT id) WHERE ROWNUM <= 10 @@ -95,7 +95,7 @@ module Arel it 'creates a different subquery when there is an offset' do stmt = Nodes::SelectStatement.new - stmt.limit = 10 + stmt.limit = Nodes::Limit.new(10) stmt.offset = Nodes::Offset.new(10) sql = @visitor.accept stmt sql.must_be_like %{ @@ -110,7 +110,7 @@ module Arel it 'is idempotent with different subquery' do stmt = Nodes::SelectStatement.new - stmt.limit = 10 + stmt.limit = Nodes::Limit.new(10) stmt.offset = Nodes::Offset.new(10) sql = @visitor.accept stmt sql2 = @visitor.accept stmt |