aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_mysql.rb
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-01-06 00:32:10 -0200
committerRafael França <rafaelmfranca@gmail.com>2016-01-06 00:32:10 -0200
commitffc4b8e93af4356110c7a2573cc3340145baa02b (patch)
treee19640d2eabfeabad80c61a95a589a8b42d56703 /test/visitors/test_mysql.rb
parentdfd22638c2773d843ea1d2e56992a6ac355b3ecb (diff)
parent83c47c1962827698eb0ed58d191f121cedf89385 (diff)
downloadrails-ffc4b8e93af4356110c7a2573cc3340145baa02b.tar.gz
rails-ffc4b8e93af4356110c7a2573cc3340145baa02b.tar.bz2
rails-ffc4b8e93af4356110c7a2573cc3340145baa02b.zip
Merge pull request #410 from kbrock/concat
Add database specific string concatenation
Diffstat (limited to 'test/visitors/test_mysql.rb')
-rw-r--r--test/visitors/test_mysql.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/visitors/test_mysql.rb b/test/visitors/test_mysql.rb
index 8e4b9e6861..30dcea3d36 100644
--- a/test/visitors/test_mysql.rb
+++ b/test/visitors/test_mysql.rb
@@ -55,6 +55,24 @@ module Arel
compile(node).must_be_like "LOCK IN SHARE MODE"
end
end
+
+ describe "concat" do
+ it "concats columns" do
+ @table = Table.new(:users)
+ query = @table[:name].concat(@table[:name])
+ compile(query).must_be_like %{
+ CONCAT("users"."name", "users"."name")
+ }
+ end
+
+ it "concats a string" do
+ @table = Table.new(:users)
+ query = @table[:name].concat(Nodes.build_quoted('abc'))
+ compile(query).must_be_like %{
+ CONCAT("users"."name", 'abc')
+ }
+ end
+ end
end
end
end