aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/engines/sql/unit/relations/join_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/arel/engines/sql/unit/relations/join_spec.rb')
-rw-r--r--spec/arel/engines/sql/unit/relations/join_spec.rb31
1 files changed, 30 insertions, 1 deletions
diff --git a/spec/arel/engines/sql/unit/relations/join_spec.rb b/spec/arel/engines/sql/unit/relations/join_spec.rb
index e2fc4bab3d..b926c2aaab 100644
--- a/spec/arel/engines/sql/unit/relations/join_spec.rb
+++ b/spec/arel/engines/sql/unit/relations/join_spec.rb
@@ -103,7 +103,36 @@ module Arel
})
end
end
- end
+
+ it "passes the string when there are multiple string joins" do
+ relation = StringJoin.new(@relation1, "INNER JOIN asdf ON fdsa")
+ relation = StringJoin.new(relation, "INNER JOIN lifo ON fifo")
+ sql = StringJoin.new(relation, "INNER JOIN hatful ON hallow").to_sql
+
+ adapter_is :mysql do
+ sql.should be_like(%Q{
+ SELECT `users`.`id`, `users`.`name`
+ FROM `users`
+ INNER JOIN asdf ON fdsa
+ INNER JOIN lifo ON fifo
+ INNER JOIN hatful ON hallow
+ })
+ end
+
+ adapter_is_not :mysql do
+ sql.should be_like(%Q{
+ SELECT "users"."id", "users"."name"
+ FROM "users"
+ INNER JOIN asdf ON fdsa
+ INNER JOIN lifo ON fifo
+ INNER JOIN hatful ON hallow
+ })
+ end
+ end
+
+ end
+
+
end
end
end