Skip to content

Commit 436a747

Browse files
jrafaniemetaskills
authored andcommitted
Added failing test for inline functions with parameters. This fails because custom ordering code splits on comma.
1 parent bebee28 commit 436a747

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/cases/order_test_sqlserver.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ class OrderTestSqlserver < ActiveRecord::TestCase
9393
assert_equal post1, Post.order(order).first
9494
end
9595

96+
should 'support inline function with parameters' do
97+
order = "SUBSTRING(title, 1, 3)"
98+
post1 = Post.create :title => 'AAA Post', :body => 'Test cased orders.'
99+
assert_equal post1, Post.order(order).first
100+
end
101+
96102
should 'support primary: inline function, secondary: column' do
97103
order = "LEN(title), body"
98104
post1 = Post.create :title => 'A', :body => 'AAA Test cased orders.'

0 commit comments

Comments
 (0)