From c96155c4fdd9a15eeca6e59ca3f35197d2ad3541 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Fri, 16 May 2008 15:08:50 -0700 Subject: custom matcher --- spec/arel/integration/joins/with_adjacency_spec.rb | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'spec/arel/integration') diff --git a/spec/arel/integration/joins/with_adjacency_spec.rb b/spec/arel/integration/joins/with_adjacency_spec.rb index e75ae3766e..4ffdf1f64f 100644 --- a/spec/arel/integration/joins/with_adjacency_spec.rb +++ b/spec/arel/integration/joins/with_adjacency_spec.rb @@ -92,33 +92,33 @@ module Arel describe '[]' do describe 'when given an attribute belonging to both sub-relations' do it 'disambiguates the relation that serves as the ancestor to the attribute' do - relation = @relation1.join(@relation2).on(@predicate) - relation[@relation1[:id]].ancestor.should == @relation1[:id] - relation[@relation2[:id]].ancestor.should == @relation2[:id] + @relation1 \ + .join(@relation2) \ + .on(@predicate) \ + .should disambiguate_attributes(@relation1[:id], @relation2[:id]) end - describe 'when the left relation is compound' do + describe 'when the left relation is extremely compound' do it 'disambiguates the relation that serves as the ancestor to the attribute' do - relation = @relation1 \ - .select(@predicate) \ - .select(@predicate) \ - .join(@relation2) \ - .on(@predicate) - relation[@relation1[:id]].should be_descends_from(@relation1[:id]) - relation[@relation1[:id]].should_not be_descends_from(@relation2[:id]) + @relation1 \ + .select(@predicate) \ + .select(@predicate) \ + .join(@relation2) \ + .on(@predicate) \ + .should disambiguate_attributes(@relation1[:id], @relation2[:id]) end end - describe 'when the right relation is compound' do + describe 'when the right relation is extremely compound' do it 'disambiguates the relation that serves as the ancestor to the attribute' do - relation = @relation1 \ - .join( \ - @relation2 \ - .select(@predicate) \ - .select(@predicate) \ - .select(@predicate)) \ - .on(@predicate) - relation[@relation2[:id]].should be_descends_from(@relation2[:id]) + @relation1 \ + .join( \ + @relation2 \ + .select(@predicate) \ + .select(@predicate) \ + .select(@predicate)) \ + .on(@predicate) \ + .should disambiguate_attributes(@relation1[:id], @relation2[:id]) end end end -- cgit v1.2.3