aboutsummaryrefslogtreecommitdiffstats
path: root/test/visitors
diff options
context:
space:
mode:
Diffstat (limited to 'test/visitors')
-rw-r--r--test/visitors/test_depth_first.rb8
-rw-r--r--test/visitors/test_join_sql.rb13
2 files changed, 11 insertions, 10 deletions
diff --git a/test/visitors/test_depth_first.rb b/test/visitors/test_depth_first.rb
index 7d7324f627..23b011c2eb 100644
--- a/test/visitors/test_depth_first.rb
+++ b/test/visitors/test_depth_first.rb
@@ -66,15 +66,15 @@ module Arel
end
def test_inner_join
- join = Nodes::InnerJoin.new :a, :b, :c
+ join = Nodes::InnerJoin.new :a, :b
@visitor.accept join
- assert_equal [:a, :b, :c, join], @collector.calls
+ assert_equal [:a, :b, join], @collector.calls
end
def test_outer_join
- join = Nodes::OuterJoin.new :a, :b, :c
+ join = Nodes::OuterJoin.new :a, :b
@visitor.accept join
- assert_equal [:a, :b, :c, join], @collector.calls
+ assert_equal [:a, :b, join], @collector.calls
end
[
diff --git a/test/visitors/test_join_sql.rb b/test/visitors/test_join_sql.rb
index 181ef6c570..b0eba172e6 100644
--- a/test/visitors/test_join_sql.rb
+++ b/test/visitors/test_join_sql.rb
@@ -11,9 +11,9 @@ module Arel
describe 'inner join' do
it 'should visit left if left is a join' do
t = Table.new :users
- join = Nodes::InnerJoin.new t, t, Nodes::On.new(t[:id])
- j2 = Nodes::InnerJoin.new join, t, Nodes::On.new(t[:id])
- @visitor.accept(j2).must_be_like %{
+ sm = t.select_manager
+ sm.join(t).on(t[:id]).join(t).on(t[:id])
+ sm.join_sql.must_be_like %{
INNER JOIN "users" ON "users"."id"
INNER JOIN "users" ON "users"."id"
}
@@ -23,9 +23,10 @@ module Arel
describe 'outer join' do
it 'should visit left if left is a join' do
t = Table.new :users
- join = Nodes::OuterJoin.new t, t, Nodes::On.new(t[:id])
- j2 = Nodes::OuterJoin.new join, t, Nodes::On.new(t[:id])
- @visitor.accept(j2).must_be_like %{
+ sm = t.select_manager
+ sm.join(t, Nodes::OuterJoin).on(t[:id]).join(
+ t, Nodes::OuterJoin).on(t[:id])
+ sm.join_sql.must_be_like %{
LEFT OUTER JOIN "users" ON "users"."id"
LEFT OUTER JOIN "users" ON "users"."id"
}