aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes
diff options
context:
space:
mode:
authorCarson Reinke <carson@reinke.co>2015-07-23 09:55:59 -0400
committerCarson Reinke <carson@reinke.co>2015-07-23 09:55:59 -0400
commit1aecf8b41ca3f238cb41c03902dacc8a5e3039f4 (patch)
treeab99193088af91dedc4e3e5cd2b22a81836c7faf /test/nodes
parent935796f4fd7d75950db87156d6540028a9044fdf (diff)
downloadrails-1aecf8b41ca3f238cb41c03902dacc8a5e3039f4.tar.gz
rails-1aecf8b41ca3f238cb41c03902dacc8a5e3039f4.tar.bz2
rails-1aecf8b41ca3f238cb41c03902dacc8a5e3039f4.zip
Add OrderPredications back into Nodes::Function (removed with deprecation of Expression)
Diffstat (limited to 'test/nodes')
-rw-r--r--test/nodes/test_sum.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/nodes/test_sum.rb b/test/nodes/test_sum.rb
index d65cd31d4b..d387e7f9ef 100644
--- a/test/nodes/test_sum.rb
+++ b/test/nodes/test_sum.rb
@@ -21,4 +21,13 @@ describe Arel::Nodes::Sum do
assert_equal 2, array.uniq.size
end
end
+
+ describe 'order' do
+ it 'should order the sum' do
+ table = Arel::Table.new :users
+ table[:id].sum.desc.to_sql.must_be_like %{
+ SUM("users"."id") DESC
+ }
+ end
+ end
end