aboutsummaryrefslogtreecommitdiffstats
path: root/test/nodes/test_count.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/nodes/test_count.rb')
-rw-r--r--test/nodes/test_count.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/nodes/test_count.rb b/test/nodes/test_count.rb
index 85e93b1927..29883df681 100644
--- a/test/nodes/test_count.rb
+++ b/test/nodes/test_count.rb
@@ -31,4 +31,13 @@ describe Arel::Nodes::Count do
assert_equal 2, array.uniq.size
end
end
+
+ describe 'math' do
+ it 'allows mathematical functions' do
+ table = Arel::Table.new :users
+ (table[:id].count + 1).to_sql.must_be_like %{
+ (COUNT("users"."id") + 1)
+ }
+ end
+ end
end