diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-05 16:04:41 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-01-05 16:04:41 -0800 |
commit | b8a4dabab94bfaa73ec031337ce9ef9abd798383 (patch) | |
tree | cb04af99acd16c8e7ca9e6b731a78d69358229bd /spec/relations | |
parent | 648209d11f16243a9f073b177e6b32ce8c094408 (diff) | |
download | rails-b8a4dabab94bfaa73ec031337ce9ef9abd798383.tar.gz rails-b8a4dabab94bfaa73ec031337ce9ef9abd798383.tar.bz2 rails-b8a4dabab94bfaa73ec031337ce9ef9abd798383.zip |
quoting
Diffstat (limited to 'spec/relations')
-rw-r--r-- | spec/relations/join_relation_spec.rb | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/relations/join_relation_spec.rb b/spec/relations/join_relation_spec.rb index b70bf553b1..ece7e61cc1 100644 --- a/spec/relations/join_relation_spec.rb +++ b/spec/relations/join_relation_spec.rb @@ -20,23 +20,18 @@ describe JoinRelation do describe '#qualify' do it 'distributes over the relations and predicates' do - JoinRelation.new(@relation1, @relation2, @predicate).qualify. \ - should == JoinRelation.new(@relation1.qualify, @relation2.qualify, @predicate.qualify) + InnerJoinRelation.new(@relation1, @relation2, @predicate).qualify. \ + should == InnerJoinRelation.new(@relation1.qualify, @relation2.qualify, @predicate.qualify) end end describe '#to_sql' do before do @relation1 = @relation1.select(@relation1[:id] == @relation2[:foo_id]) - class ConcreteJoinRelation < JoinRelation - def join_type - :inner_join - end - end end it 'manufactures sql joining the two tables on the predicate, merging the selects' do - ConcreteJoinRelation.new(@relation1, @relation2, @predicate).to_s.should == SelectBuilder.new do + InnerJoinRelation.new(@relation1, @relation2, @predicate).to_s.should == SelectBuilder.new do select do column :foo, :name column :foo, :id |