diff options
Diffstat (limited to 'test/visitors/test_postgres.rb')
-rw-r--r-- | test/visitors/test_postgres.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/visitors/test_postgres.rb b/test/visitors/test_postgres.rb index b98f78ca12..6e8f399b6b 100644 --- a/test/visitors/test_postgres.rb +++ b/test/visitors/test_postgres.rb @@ -15,10 +15,12 @@ module Arel it "should escape LIMIT" do sc = Arel::Nodes::SelectStatement.new - sc.limit = "omg" + sc.limit = Nodes::Limit.new("omg") sc.cores.first.projections << 'DISTINCT ON' sc.orders << "xyz" - assert_match(/LIMIT 'omg'/, @visitor.accept(sc)) + sql = @visitor.accept(sc) + assert_match(/LIMIT 'omg'/, sql) + assert_equal 1, sql.scan(/LIMIT/).length, 'should have one limit' end end end |