diff options
Diffstat (limited to 'spec/arel/nodes/sum_spec.rb')
-rw-r--r-- | spec/arel/nodes/sum_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/arel/nodes/sum_spec.rb b/spec/arel/nodes/sum_spec.rb new file mode 100644 index 0000000000..7691b06590 --- /dev/null +++ b/spec/arel/nodes/sum_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe Arel::Nodes::Sum do + describe "as" do + it 'should alias the sum' do + table = Arel::Table.new :users + table[:id].sum.as('foo').to_sql.should be_like %{ + SUM("users"."id") AS foo + } + end + end +end |