diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/arel/unit/primitives/attribute_spec.rb | 10 | ||||
-rw-r--r-- | spec/arel/unit/primitives/expression_spec.rb | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/spec/arel/unit/primitives/attribute_spec.rb b/spec/arel/unit/primitives/attribute_spec.rb index 6d0f146a39..e512b40ebf 100644 --- a/spec/arel/unit/primitives/attribute_spec.rb +++ b/spec/arel/unit/primitives/attribute_spec.rb @@ -139,31 +139,31 @@ module Arel describe '#count' do it "manufactures a count Expression" do - @attribute.count.should == Expression.new(@attribute, "COUNT") + @attribute.count.should == Count.new(@attribute) end end describe '#sum' do it "manufactures a sum Expression" do - @attribute.sum.should == Expression.new(@attribute, "SUM") + @attribute.sum.should == Sum.new(@attribute) end end describe '#maximum' do it "manufactures a maximum Expression" do - @attribute.maximum.should == Expression.new(@attribute, "MAX") + @attribute.maximum.should == Maximum.new(@attribute) end end describe '#minimum' do it "manufactures a minimum Expression" do - @attribute.minimum.should == Expression.new(@attribute, "MIN") + @attribute.minimum.should == Minimum.new(@attribute) end end describe '#average' do it "manufactures an average Expression" do - @attribute.average.should == Expression.new(@attribute, "AVG") + @attribute.average.should == Average.new(@attribute) end end end diff --git a/spec/arel/unit/primitives/expression_spec.rb b/spec/arel/unit/primitives/expression_spec.rb index ebde55ff90..92f300c4ee 100644 --- a/spec/arel/unit/primitives/expression_spec.rb +++ b/spec/arel/unit/primitives/expression_spec.rb @@ -9,13 +9,13 @@ module Arel describe Expression::Transformations do before do - @expression = Expression.new(@attribute, "COUNT") + @expression = Count.new(@attribute) end describe '#bind' do it "manufactures an attribute with a rebound relation and self as the ancestor" do derived_relation = @relation.where(@relation[:id].eq(1)) - @expression.bind(derived_relation).should == Expression.new(@attribute.bind(derived_relation), "COUNT", nil, @expression) + @expression.bind(derived_relation).should == Count.new(@attribute.bind(derived_relation), nil, @expression) end it "returns self if the substituting to the same relation" do @@ -25,7 +25,7 @@ module Arel describe '#as' do it "manufactures an aliased expression" do - @expression.as(:alias).should == Expression.new(@attribute, "COUNT", :alias, @expression) + @expression.as(:alias).should == Expression.new(@attribute, :alias, @expression) end end @@ -38,7 +38,7 @@ module Arel describe '#to_sql' do it "manufactures sql with the expression and alias" do - sql = Expression.new(@attribute, "COUNT", :alias).to_sql + sql = Count.new(@attribute, :alias).to_sql adapter_is :mysql do sql.should be_like(%Q{COUNT(`users`.`id`) AS `alias`}) |