From 1120f8956729715027e47ddd76102c319d41a89b Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Fri, 24 Oct 2014 12:26:02 +0530 Subject: - Added test for verifying proper sql generated by minimum aggregate method. --- test/attributes/test_attribute.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/attributes/test_attribute.rb b/test/attributes/test_attribute.rb index b50bb60b1e..768df23d4d 100644 --- a/test/attributes/test_attribute.rb +++ b/test/attributes/test_attribute.rb @@ -329,7 +329,7 @@ module Arel relation[:id].maximum.must_be_kind_of Nodes::Max end - it 'should generate the proper SQL' do + it 'should generate proper SQL' do relation = Table.new(:users) mgr = relation.project relation[:id].maximum mgr.to_sql.must_be_like %{ @@ -344,6 +344,15 @@ module Arel relation = Table.new(:users) relation[:id].minimum.must_be_kind_of Nodes::Min end + + it 'should generate proper SQL' do + relation = Table.new(:users) + mgr = relation.project relation[:id].minimum + mgr.to_sql.must_be_like %{ + SELECT MIN("users"."id") + FROM "users" + } + end end describe '#sum' do -- cgit v1.2.3