aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/arel/select_manager_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/arel/select_manager_spec.rb b/spec/arel/select_manager_spec.rb
index 6155842241..f894d3230a 100644
--- a/spec/arel/select_manager_spec.rb
+++ b/spec/arel/select_manager_spec.rb
@@ -56,6 +56,22 @@ module Arel
end
end
+ describe 'join' do
+ it 'responds to join' do
+ left = Table.new :users
+ right = left.alias
+ predicate = left[:id].eq(right[:id])
+ manager = Arel::SelectManager.new Table.engine
+
+ manager.join(right).on(predicate)
+ manager.to_sql.should be_like %{
+ SELECT FROM "users"
+ OUTER JOIN "users" "users_2"
+ ON "users"."id" = "users_2"."id"
+ }
+ end
+ end
+
describe 'joins' do
it 'returns join sql' do
table = Table.new :users