aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation
diff options
context:
space:
mode:
Diffstat (limited to 'spec/active_relation')
-rw-r--r--spec/active_relation/unit/predicates/binary_spec.rb15
-rw-r--r--spec/active_relation/unit/predicates/equality_spec.rb2
-rw-r--r--spec/active_relation/unit/primitives/attribute_spec.rb16
3 files changed, 10 insertions, 23 deletions
diff --git a/spec/active_relation/unit/predicates/binary_spec.rb b/spec/active_relation/unit/predicates/binary_spec.rb
index 04f8d4f305..5dd5e5599a 100644
--- a/spec/active_relation/unit/predicates/binary_spec.rb
+++ b/spec/active_relation/unit/predicates/binary_spec.rb
@@ -24,7 +24,7 @@ module ActiveRelation
describe 'when relating an attribute and a value' do
before do
- @value = "1-asdf".bind(@relation)
+ @value = "1-asdf"
end
describe 'when relating to an integer attribute' do
@@ -43,19 +43,6 @@ module ActiveRelation
end
end
end
-
- describe 'when relating two values' do
- before do
- @value = "1-asdf".bind(@relation)
- @another_value = 2.bind(@relation)
- end
-
- it 'formats values appropos of their type' do
- ConcreteBinary.new(string = @value, integer = @another_value).to_sql.should be_like("
- '1-asdf' <=> 2
- ")
- end
- end
end
describe '==' do
diff --git a/spec/active_relation/unit/predicates/equality_spec.rb b/spec/active_relation/unit/predicates/equality_spec.rb
index 613236ad04..5415b35925 100644
--- a/spec/active_relation/unit/predicates/equality_spec.rb
+++ b/spec/active_relation/unit/predicates/equality_spec.rb
@@ -35,7 +35,7 @@ module ActiveRelation
describe 'when relation to a nil value' do
before do
- @nil = nil.bind(@relation1)
+ @nil = nil
end
it "manufactures an is null predicate" do
diff --git a/spec/active_relation/unit/primitives/attribute_spec.rb b/spec/active_relation/unit/primitives/attribute_spec.rb
index 0f6e5e289d..fbbcbaef37 100644
--- a/spec/active_relation/unit/primitives/attribute_spec.rb
+++ b/spec/active_relation/unit/primitives/attribute_spec.rb
@@ -21,7 +21,7 @@ module ActiveRelation
end
it "returns self if the substituting to the same relation" do
- @attribute.bind(@relation).should == @attribute
+ @attribute.should == @attribute
end
end
@@ -97,43 +97,43 @@ module ActiveRelation
describe '#eq' do
it "manufactures an equality predicate" do
- @attribute.eq('name').should == Equality.new(@attribute, 'name'.bind(@relation))
+ @attribute.eq('name').should == Equality.new(@attribute, 'name')
end
end
describe '#lt' do
it "manufactures a less-than predicate" do
- @attribute.lt(10).should == LessThan.new(@attribute, 10.bind(@relation))
+ @attribute.lt(10).should == LessThan.new(@attribute, 10)
end
end
describe '#lteq' do
it "manufactures a less-than or equal-to predicate" do
- @attribute.lteq(10).should == LessThanOrEqualTo.new(@attribute, 10.bind(@relation))
+ @attribute.lteq(10).should == LessThanOrEqualTo.new(@attribute, 10)
end
end
describe '#gt' do
it "manufactures a greater-than predicate" do
- @attribute.gt(10).should == GreaterThan.new(@attribute, 10.bind(@relation))
+ @attribute.gt(10).should == GreaterThan.new(@attribute, 10)
end
end
describe '#gteq' do
it "manufactures a greater-than or equal-to predicate" do
- @attribute.gteq(10).should == GreaterThanOrEqualTo.new(@attribute, 10.bind(@relation))
+ @attribute.gteq(10).should == GreaterThanOrEqualTo.new(@attribute, 10)
end
end
describe '#matches' do
it "manufactures a match predicate" do
- @attribute.matches(/.*/).should == Match.new(@attribute, /.*/.bind(@relation))
+ @attribute.matches(/.*/).should == Match.new(@attribute, /.*/)
end
end
describe '#in' do
it "manufactures an in predicate" do
- @attribute.in(1..30).should == In.new(@attribute, (1..30).bind(@relation))
+ @attribute.in(1..30).should == In.new(@attribute, (1..30))
end
end
end