diff options
Diffstat (limited to 'test/nodes')
-rw-r--r-- | test/nodes/test_over.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/nodes/test_over.rb b/test/nodes/test_over.rb index fcc5078e7b..0bdd665e56 100644 --- a/test/nodes/test_over.rb +++ b/test/nodes/test_over.rb @@ -1,6 +1,15 @@ require 'helper' describe Arel::Nodes::Over do + describe 'as' do + it 'should alias the expression' do + table = Arel::Table.new :users + table[:id].count.over.as('foo').to_sql.must_be_like %{ + COUNT("users"."id") OVER () AS foo + } + end + end + describe 'with literal' do it 'should reference the window definition by name' do table = Arel::Table.new :users |