aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation/unit/relations/join_spec.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 15:22:22 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 15:22:22 -0700
commiteee3a766160cd32a4d9b5e1352858597005c9cee (patch)
tree10b58d7c350198a0598e1387e221fb1fe8fc0078 /spec/active_relation/unit/relations/join_spec.rb
parentad50e772d32c261e4463d67d5c50a25b21a36370 (diff)
downloadrails-eee3a766160cd32a4d9b5e1352858597005c9cee.tar.gz
rails-eee3a766160cd32a4d9b5e1352858597005c9cee.tar.bz2
rails-eee3a766160cd32a4d9b5e1352858597005c9cee.zip
string passthrough for joins
Diffstat (limited to 'spec/active_relation/unit/relations/join_spec.rb')
-rw-r--r--spec/active_relation/unit/relations/join_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/active_relation/unit/relations/join_spec.rb b/spec/active_relation/unit/relations/join_spec.rb
index 30ac73b611..b274da7565 100644
--- a/spec/active_relation/unit/relations/join_spec.rb
+++ b/spec/active_relation/unit/relations/join_spec.rb
@@ -108,7 +108,7 @@ module ActiveRelation
end
end
- describe 'with aggregated relations' do
+ describe 'when joining aggregated relations' do
before do
@aggregation = @relation2 \
.aggregate(@relation2[:user_id], @relation2[:id].count) \
@@ -157,6 +157,16 @@ module ActiveRelation
")
end
end
- end
+ end
+
+ describe 'when joining with a string' do
+ it "passes the string through to the where clause" do
+ Join.new("INNER JOIN ON asdf", @relation1).to_sql.should be_like("
+ SELECT `users`.`id`, `users`.`name`
+ FROM `users`
+ INNER JOIN ON asdf
+ ")
+ end
+ end
end
end \ No newline at end of file