aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_postgres.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-02-21 15:11:14 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-02-21 15:11:14 -0800
commit1c48bef21533039c81fdcaf868be518d5c16e383 (patch)
treea56c1d1c81fbc680c230b550458b3d1816252c04 /test/visitors/test_postgres.rb
parenta4c10530e70fc42358cf7ea32440376f2c3c4c58 (diff)
parent6c65b0176223c90e08903ebc1a9a1075659f2c43 (diff)
downloadrails-1c48bef21533039c81fdcaf868be518d5c16e383.tar.gz
rails-1c48bef21533039c81fdcaf868be518d5c16e383.tar.bz2
rails-1c48bef21533039c81fdcaf868be518d5c16e383.zip
Merge remote branch 'jstorimer/master' into omg
* jstorimer/master: Allow database specific locking clauses to be used
Diffstat (limited to 'test/visitors/test_postgres.rb')
-rw-r--r--test/visitors/test_postgres.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/visitors/test_postgres.rb b/test/visitors/test_postgres.rb
index 8d3f19aa6e..9ed42b1806 100644
--- a/test/visitors/test_postgres.rb
+++ b/test/visitors/test_postgres.rb
@@ -7,10 +7,19 @@ module Arel
@visitor = PostgreSQL.new Table.engine
end
- it 'should produce a lock value' do
- @visitor.accept(Nodes::Lock.new).must_be_like %{
- FOR UPDATE
- }
+ describe 'locking' do
+ it 'defaults to FOR UPDATE' do
+ @visitor.accept(Nodes::Lock.new).must_be_like %{
+ FOR UPDATE
+ }
+ end
+
+ it 'allows a custom string to be used as a lock' do
+ node = Nodes::Lock.new('FOR SHARE')
+ @visitor.accept(node).must_be_like %{
+ FOR SHARE
+ }
+ end
end
it "should escape LIMIT" do