diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 16:37:11 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-07 16:37:11 -0700 |
commit | 5ab502a755d0031d229278b6f14123c45623dd04 (patch) | |
tree | 3c2948cda53c1c33d69b8d81542ce2d407adc512 /spec/arel/attributes | |
parent | cea486ac810a92ef4f96ef84e3a412fd7a4f6925 (diff) | |
download | rails-5ab502a755d0031d229278b6f14123c45623dd04.tar.gz rails-5ab502a755d0031d229278b6f14123c45623dd04.tar.bz2 rails-5ab502a755d0031d229278b6f14123c45623dd04.zip |
adding "as" and to_sql to count nodes
Diffstat (limited to 'spec/arel/attributes')
-rw-r--r-- | spec/arel/attributes/attribute_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/arel/attributes/attribute_spec.rb b/spec/arel/attributes/attribute_spec.rb index e6e6483e64..f9eb56391e 100644 --- a/spec/arel/attributes/attribute_spec.rb +++ b/spec/arel/attributes/attribute_spec.rb @@ -3,6 +3,13 @@ require 'spec_helper' module Arel module Attributes describe 'attribute' do + describe '#count' do + it 'should return a count node' do + relation = Table.new(:users) + relation[:id].count.should be_kind_of Nodes::Count + end + end + describe '#eq' do it 'should return an equality node' do attribute = Attribute.new nil, nil, nil |