aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_to_sql.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-06 20:26:15 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-12-06 20:26:15 -0800
commitee65dd6e0e5c79fa2d79944dbc541380f4b221d4 (patch)
tree9d83f4d5ec754826a7361d39b7b7d22efc0009f3 /test/visitors/test_to_sql.rb
parent13d22766902af1d6f709b85a73e089b7afbb9dbf (diff)
parent4018b5d66a810a34273d4b198688896f6f7459f3 (diff)
downloadrails-ee65dd6e0e5c79fa2d79944dbc541380f4b221d4.tar.gz
rails-ee65dd6e0e5c79fa2d79944dbc541380f4b221d4.tar.bz2
rails-ee65dd6e0e5c79fa2d79944dbc541380f4b221d4.zip
Merge branch '2-0-stable'
* 2-0-stable: quoting limit nodes Make "not" apply to the whole sub-expression when generating sql.
Diffstat (limited to 'test/visitors/test_to_sql.rb')
-rw-r--r--test/visitors/test_to_sql.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb
index bae291d87c..09f037f75f 100644
--- a/test/visitors/test_to_sql.rb
+++ b/test/visitors/test_to_sql.rb
@@ -30,6 +30,12 @@ module Arel
@visitor.accept(DateTime).must_equal "'DateTime'"
end
+ it "should escape LIMIT" do
+ sc = Arel::Nodes::SelectStatement.new
+ sc.limit = "omg"
+ assert_match(/LIMIT 'omg'/, @visitor.accept(sc))
+ end
+
it "should visit_DateTime" do
@visitor.accept DateTime.now
end