diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-21 15:40:38 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-21 15:40:38 -0800 |
commit | c7eef391dbcf3364f3792c0e0bbffd4bc3e139d0 (patch) | |
tree | c8a2bb438272392aaf1126769d213dbabc54c81e /test | |
parent | 8ed3ab00f1ba8cdf48dea4ca28d2d3a7e73396ab (diff) | |
download | rails-c7eef391dbcf3364f3792c0e0bbffd4bc3e139d0.tar.gz rails-c7eef391dbcf3364f3792c0e0bbffd4bc3e139d0.tar.bz2 rails-c7eef391dbcf3364f3792c0e0bbffd4bc3e139d0.zip |
refactoring custom lock logic to use sql literals
Diffstat (limited to 'test')
-rw-r--r-- | test/visitors/test_mysql.rb | 4 | ||||
-rw-r--r-- | test/visitors/test_postgres.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/visitors/test_mysql.rb b/test/visitors/test_mysql.rb index ee70d4c174..3c15c218b2 100644 --- a/test/visitors/test_mysql.rb +++ b/test/visitors/test_mysql.rb @@ -31,12 +31,12 @@ module Arel describe 'locking' do it 'defaults to FOR UPDATE when locking' do - node = Nodes::Lock.new true + node = Nodes::Lock.new(Arel.sql('FOR UPDATE')) @visitor.accept(node).must_be_like "FOR UPDATE" end it 'allows a custom string to be used as a lock' do - node = Nodes::Lock.new('LOCK IN SHARE MODE') + node = Nodes::Lock.new(Arel.sql('LOCK IN SHARE MODE')) @visitor.accept(node).must_be_like "LOCK IN SHARE MODE" end end diff --git a/test/visitors/test_postgres.rb b/test/visitors/test_postgres.rb index 169510185e..74446c23ba 100644 --- a/test/visitors/test_postgres.rb +++ b/test/visitors/test_postgres.rb @@ -9,13 +9,13 @@ module Arel describe 'locking' do it 'defaults to FOR UPDATE' do - @visitor.accept(Nodes::Lock.new(true)).must_be_like %{ + @visitor.accept(Nodes::Lock.new(Arel.sql('FOR UPDATE'))).must_be_like %{ FOR UPDATE } end it 'allows a custom string to be used as a lock' do - node = Nodes::Lock.new('FOR SHARE') + node = Nodes::Lock.new(Arel.sql('FOR SHARE')) @visitor.accept(node).must_be_like %{ FOR SHARE } |