From 3e0421b9cc77979f7ec0cbf1daf8bc31f355fd77 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Tue, 17 Nov 2020 18:18:00 -0800 Subject: [PATCH] Fixed sqlite tests [skip ci] --- test/percentile_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/percentile_test.rb b/test/percentile_test.rb index af4d5e0..9998ed0 100644 --- a/test/percentile_test.rb +++ b/test/percentile_test.rb @@ -13,6 +13,7 @@ def test_even def test_odd skip if sqlite? + [15, 20, 35, 40, 50].each { |n| User.create!(visits_count: n) } assert_equal 29, User.percentile(:visits_count, 0.4) end @@ -28,19 +29,21 @@ def test_one end def test_high + skip if sqlite? + [1, 1, 2, 3, 4, 100].each { |n| User.create!(visits_count: n) } assert_in_delta 95.2, User.percentile(:visits_count, 0.99) end def test_expression - skip if mongoid? + skip if mongoid? || sqlite? [1, 2, 3, 4].each { |n| User.create!(visits_count: n) } assert_in_delta 4.25, User.percentile(Arel.sql("visits_count + 1"), 0.75) end def test_expression_no_arel - skip if mongoid? + skip if mongoid? || sqlite? message = "[active_median] Non-attribute argument: visits_count + 1. Use Arel.sql() for known-safe values. This will raise an error in ActiveMedian 0.3.0\n" _, stderr = capture_io do