diff options
author | Edgars Beigarts <edgars.beigarts@makit.lv> | 2011-08-26 20:01:00 +0300 |
---|---|---|
committer | Edgars Beigarts <edgars.beigarts@makit.lv> | 2011-08-26 20:01:58 +0300 |
commit | 481ccefedd407c1f8941596b03e72cfe35c42d41 (patch) | |
tree | 246d9abe8c1d4a428c450276ef25d67d06161827 /test | |
parent | 2aac990e4d68cc3cbf86ecc9565723b07f22c962 (diff) | |
download | rails-481ccefedd407c1f8941596b03e72cfe35c42d41.tar.gz rails-481ccefedd407c1f8941596b03e72cfe35c42d41.tar.bz2 rails-481ccefedd407c1f8941596b03e72cfe35c42d41.zip |
Support locking by default and disable it only for SQLite.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_select_manager.rb | 2 | ||||
-rw-r--r-- | test/visitors/test_sqlite.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index 6603102a3a..7e9099d0d0 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -454,7 +454,7 @@ module Arel it 'adds a lock node' do table = Table.new :users mgr = table.from table - mgr.lock.to_sql.must_be_like %{ SELECT FROM "users" } + mgr.lock.to_sql.must_be_like %{ SELECT FROM "users" FOR UPDATE } end end diff --git a/test/visitors/test_sqlite.rb b/test/visitors/test_sqlite.rb index 5b81ea90c5..c06f554ea4 100644 --- a/test/visitors/test_sqlite.rb +++ b/test/visitors/test_sqlite.rb @@ -13,6 +13,11 @@ module Arel sql = @visitor.accept(stmt) sql.must_be_like "SELECT LIMIT -1 OFFSET 1" end + + it 'does not support locking' do + node = Nodes::Lock.new(Arel.sql('FOR UPDATE')) + @visitor.accept(node).must_be_nil + end end end end |