aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 13:47:06 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-11 13:47:06 -0700
commit42c42bfa50876b4221c024cebc47fc34fc6530a9 (patch)
tree73777a9c4f61330bd89832b312318ffb555afaca /spec
parent89b354bf97d0a981376d36f2f8a7ba6a87fe2aa8 (diff)
downloadrails-42c42bfa50876b4221c024cebc47fc34fc6530a9.tar.gz
rails-42c42bfa50876b4221c024cebc47fc34fc6530a9.tar.bz2
rails-42c42bfa50876b4221c024cebc47fc34fc6530a9.zip
moved bind to factory of select
Diffstat (limited to 'spec')
-rw-r--r--spec/active_relation/unit/relations/relation_spec.rb2
-rw-r--r--spec/active_relation/unit/relations/selection_spec.rb10
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