diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-04-11 13:47:06 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-04-11 13:47:06 -0700 |
commit | 42c42bfa50876b4221c024cebc47fc34fc6530a9 (patch) | |
tree | 73777a9c4f61330bd89832b312318ffb555afaca /spec/active_relation/unit/relations/selection_spec.rb | |
parent | 89b354bf97d0a981376d36f2f8a7ba6a87fe2aa8 (diff) | |
download | rails-42c42bfa50876b4221c024cebc47fc34fc6530a9.tar.gz rails-42c42bfa50876b4221c024cebc47fc34fc6530a9.tar.bz2 rails-42c42bfa50876b4221c024cebc47fc34fc6530a9.zip |
moved bind to factory of select
Diffstat (limited to 'spec/active_relation/unit/relations/selection_spec.rb')
-rw-r--r-- | spec/active_relation/unit/relations/selection_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
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 |