diff options
Diffstat (limited to 'spec/active_relation/unit/relations')
-rw-r--r-- | spec/active_relation/unit/relations/relation_spec.rb | 2 | ||||
-rw-r--r-- | spec/active_relation/unit/relations/selection_spec.rb | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/spec/active_relation/unit/relations/relation_spec.rb b/spec/active_relation/unit/relations/relation_spec.rb index d434a1e317..7bb85d7270 100644 --- a/spec/active_relation/unit/relations/relation_spec.rb +++ b/spec/active_relation/unit/relations/relation_spec.rb @@ -91,7 +91,7 @@ module ActiveRelation end it "accepts arbitrary strings" do - @relation.select("arbitrary").should == Selection.new(@relation, Value.new("arbitrary", @relation)) + @relation.select("arbitrary").should == Selection.new(@relation, "arbitrary") end end diff --git a/spec/active_relation/unit/relations/selection_spec.rb b/spec/active_relation/unit/relations/selection_spec.rb index 001c38c370..1919d3007e 100644 --- a/spec/active_relation/unit/relations/selection_spec.rb +++ b/spec/active_relation/unit/relations/selection_spec.rb @@ -26,9 +26,13 @@ module ActiveRelation end describe '#descend' do + before do + @selection = Selection.new(@relation, @predicate) + end + it "distributes a block over the relation and predicates" do - Selection.new(@relation, @predicate).descend(&:qualify). \ - should == Selection.new(@relation.descend(&:qualify), @predicate.descend(&:qualify)) + @selection.descend(&:qualify). \ + should == Selection.new(@selection.relation.descend(&:qualify), @selection.predicate.qualify) end end @@ -45,7 +49,7 @@ module ActiveRelation describe 'when given a string' do before do - @string = "asdf".bind(@relation) + @string = "asdf" end it "passes the string through to the where clause" do |