aboutsummaryrefslogtreecommitdiffstats
path: root/spec/arel/table_spec.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-09-07 14:49:06 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-09-07 14:49:06 -0700
commit502b43f00904967d9679b208a08beb764ce8911e (patch)
tree47576effb0de5fdaf717e62e22fd0ae1cb431462 /spec/arel/table_spec.rb
parent90881c5841c49a2e56662b6d32e8058dfb1aa8b7 (diff)
downloadrails-502b43f00904967d9679b208a08beb764ce8911e.tar.gz
rails-502b43f00904967d9679b208a08beb764ce8911e.tar.bz2
rails-502b43f00904967d9679b208a08beb764ce8911e.zip
joins are starting to work better
Diffstat (limited to 'spec/arel/table_spec.rb')
-rw-r--r--spec/arel/table_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/arel/table_spec.rb b/spec/arel/table_spec.rb
index 2ea45dcca1..78705b4f0a 100644
--- a/spec/arel/table_spec.rb
+++ b/spec/arel/table_spec.rb
@@ -12,6 +12,20 @@ module Arel
check @relation.joins(nil).should == nil
end
end
+
+ describe 'join' do
+ it 'takes a second argument for join type' do
+ right = @relation.alias
+ predicate = @relation[:id].eq(right[:id])
+ mgr = @relation.join(right, Nodes::OuterJoin).on(predicate)
+
+ mgr.to_sql.should be_like %{
+ SELECT FROM "users"
+ OUTER JOIN "users" "users_2"
+ ON "users"."id" = "users_2"."id"
+ }
+ end
+ end
end
describe 'alias' do