aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors/test_join_sql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/visitors/test_join_sql.rb')
-rw-r--r--test/visitors/test_join_sql.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/visitors/test_join_sql.rb b/test/visitors/test_join_sql.rb
index ea71c05d79..34378dafe7 100644
--- a/test/visitors/test_join_sql.rb
+++ b/test/visitors/test_join_sql.rb
@@ -25,6 +25,19 @@ module Arel
end
end
+ describe 'FULL outer join' do
+ it 'should visit left if left is a join' do
+ t = Table.new :users
+ sm = t.select_manager
+ sm.join(t, Nodes::FullOuterJoin).on(t[:id]).join(
+ t, Nodes::FullOuterJoin).on(t[:id])
+ sm.join_sql.must_be_like %{
+ FULL OUTER JOIN "users" ON "users"."id"
+ FULL OUTER JOIN "users" ON "users"."id"
+ }
+ end
+ end
+
describe 'outer join' do
it 'should visit left if left is a join' do
t = Table.new :users
@@ -37,6 +50,19 @@ module Arel
}
end
end
+
+ describe 'right outer join' do
+ it 'should visit left if left is a join' do
+ t = Table.new :users
+ sm = t.select_manager
+ sm.join(t, Nodes::RightOuterJoin).on(t[:id]).join(
+ t, Nodes::RightOuterJoin).on(t[:id])
+ sm.join_sql.must_be_like %{
+ RIGHT OUTER JOIN "users" ON "users"."id"
+ RIGHT OUTER JOIN "users" ON "users"."id"
+ }
+ end
+ end
end
end
end