aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/arel/integration/joins/with_adjacency_spec.rb25
-rw-r--r--spec/arel/unit/primitives/expression_spec.rb1
2 files changed, 26 insertions, 0 deletions
diff --git a/spec/arel/integration/joins/with_adjacency_spec.rb b/spec/arel/integration/joins/with_adjacency_spec.rb
index 74d461319c..56ead0993a 100644
--- a/spec/arel/integration/joins/with_adjacency_spec.rb
+++ b/spec/arel/integration/joins/with_adjacency_spec.rb
@@ -96,6 +96,31 @@ module Arel
relation[@relation1[:id]].ancestor.should == @relation1[:id]
relation[@relation2[:id]].ancestor.should == @relation2[:id]
end
+
+ describe 'when the left relation is compound' do
+ it '' 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])
+ end
+ end
+
+ describe 'when the right relation is compound' do
+ it '' do
+ relation = @relation1 \
+ .join( \
+ @relation2 \
+ .select(@predicate) \
+ .select(@predicate) \
+ .select(@predicate)) \
+ .on(@predicate)
+ relation[@relation2[:id]].should be_descends_from(@relation2[:id])
+ end
+ end
end
end
end
diff --git a/spec/arel/unit/primitives/expression_spec.rb b/spec/arel/unit/primitives/expression_spec.rb
index 8a990231f6..ace439b952 100644
--- a/spec/arel/unit/primitives/expression_spec.rb
+++ b/spec/arel/unit/primitives/expression_spec.rb
@@ -14,6 +14,7 @@ module Arel
describe '#bind' do
it "manufactures an attribute with a rebound relation and self as the ancestor" do
+ pending
derived_relation = @relation.select(@relation[:id].eq(1))
@expression.bind(derived_relation).should == Expression.new(@attribute.bind(derived_relation), "COUNT", nil, @expression)
end