diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-02-16 16:09:37 -0800 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-02-16 16:09:37 -0800 |
commit | d5d7a8eb9935cd937441bd5233b410e5a0cfd41b (patch) | |
tree | 6da1391c74af5b6d56f139453d8801754c7147df /spec | |
parent | c910ac7554ad4989c8dd4e942fc14ae78eeddc3d (diff) | |
download | rails-d5d7a8eb9935cd937441bd5233b410e5a0cfd41b.tar.gz rails-d5d7a8eb9935cd937441bd5233b410e5a0cfd41b.tar.bz2 rails-d5d7a8eb9935cd937441bd5233b410e5a0cfd41b.zip |
attribute is now a concrete ancestor of expression. seems logical.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/active_relation/primitives/attribute_spec.rb | 2 | ||||
-rw-r--r-- | spec/active_relation/primitives/expression_spec.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/spec/active_relation/primitives/attribute_spec.rb b/spec/active_relation/primitives/attribute_spec.rb index 6d0020d5da..535e6245b5 100644 --- a/spec/active_relation/primitives/attribute_spec.rb +++ b/spec/active_relation/primitives/attribute_spec.rb @@ -29,7 +29,7 @@ module ActiveRelation end describe '#qualify' do - it "manufactures an attribute aliased with that attributes qualified name" do + it "manufactures an attribute aliased with that attribute's qualified name" do @attribute.qualify.should == Attribute.new(@attribute.relation, @attribute.name, @attribute.qualified_name, @attribute) end end diff --git a/spec/active_relation/primitives/expression_spec.rb b/spec/active_relation/primitives/expression_spec.rb index f90ae899c3..fa854d89f9 100644 --- a/spec/active_relation/primitives/expression_spec.rb +++ b/spec/active_relation/primitives/expression_spec.rb @@ -34,6 +34,12 @@ module ActiveRelation @expression.to_attribute.should == Attribute.new(@expression.relation, @expression.alias, nil, @expression) end end + + describe '#qualify' do + it "manufactures an expression aliased with that expression's qualified name" do + @expression.qualify.should == Expression.new(@attribute, "COUNT", @expression.qualified_name, @expression) + end + end end describe '=~' do |