aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorErnie Miller <ernie@metautonomo.us>2011-03-12 10:53:47 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-03-12 10:59:03 +0800
commit05887fc406820f2e8fecc5cedcc42b87cf9f0ab1 (patch)
treee1bbf6fb59e9f7e356eba30b9d52ce63c3325d9d /test
parent21e052796d3007488d5dd9f00299a3a22fdb6249 (diff)
downloadrails-05887fc406820f2e8fecc5cedcc42b87cf9f0ab1.tar.gz
rails-05887fc406820f2e8fecc5cedcc42b87cf9f0ab1.tar.bz2
rails-05887fc406820f2e8fecc5cedcc42b87cf9f0ab1.zip
Make as factory method convert alias name to SqlLiteral
Diffstat (limited to 'test')
-rw-r--r--test/nodes/test_as.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/nodes/test_as.rb b/test/nodes/test_as.rb
index 8585fbc963..02cbe5f7b0 100644
--- a/test/nodes/test_as.rb
+++ b/test/nodes/test_as.rb
@@ -10,6 +10,12 @@ module Arel
assert_equal attr, as.left
assert_equal 'foo', as.right
end
+
+ it 'converts right to SqlLiteral if a string' do
+ attr = Table.new(:users)[:id]
+ as = attr.as('foo')
+ assert_kind_of Arel::Nodes::SqlLiteral, as.right
+ end
end
end
end