From 89194f5976d09a62f967e550daeda41ac0b9de48 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 7 Dec 2010 11:44:32 -0800 Subject: adding a join factory method on the select manager --- test/test_table.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/test_table.rb') diff --git a/test/test_table.rb b/test/test_table.rb index bb7bd255fd..7d773b2e2b 100644 --- a/test/test_table.rb +++ b/test/test_table.rb @@ -6,6 +6,22 @@ module Arel @relation = Table.new(:users) end + it 'should create join nodes' do + join = @relation.create_join 'foo', 'bar', 'baz' + assert_kind_of Arel::Nodes::InnerJoin, join + assert_equal 'foo', join.left + assert_equal 'bar', join.right + assert_equal 'baz', join.constraint + end + + it 'should create join nodes with a klass' do + join = @relation.create_join 'foo', 'bar', 'baz', Arel::Nodes::OuterJoin + assert_kind_of Arel::Nodes::OuterJoin, join + assert_equal 'foo', join.left + assert_equal 'bar', join.right + assert_equal 'baz', join.constraint + end + it 'should return an insert manager' do im = @relation.compile_insert 'VALUES(NULL)' assert_kind_of Arel::InsertManager, im -- cgit v1.2.3