diff options
Diffstat (limited to 'test/visitors/test_mssql.rb')
-rw-r--r-- | test/visitors/test_mssql.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/visitors/test_mssql.rb b/test/visitors/test_mssql.rb index b658e46828..ccaea395fe 100644 --- a/test/visitors/test_mssql.rb +++ b/test/visitors/test_mssql.rb @@ -13,6 +13,15 @@ module Arel sql = @visitor.accept(stmt) sql.must_be_like "SELECT TOP 1" end + + it 'uses TOP in updates with a limit' do + stmt = Nodes::UpdateStatement.new + stmt.limit = Nodes::Limit.new(1) + stmt.key = 'id' + sql = @visitor.accept(stmt) + sql.must_be_like "UPDATE NULL WHERE 'id' IN (SELECT TOP 1 'id' )" + end + end end end |