Skip to content

Commit ea7b1e6

Browse files
committed
Try fixing CI tests again
1 parent a022fa4 commit ea7b1e6

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/models/page_test.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,19 @@ class PageTest < ActiveSupport::TestCase
270270
assert_equal(['maintainer1', 'maintainer2', 'maintainer3'], page1.maintainers.pluck(:name))
271271
assert_equal(3, page1.urls.count, 'Page1 has all the unique URLs from the pages')
272272
assert_equal(0, page2.urls.count, 'Page2 has no more URLs')
273+
# NOTE: depending on the system and on PG, there may be precision issues
274+
# data, so round before checking them.
273275
assert_equal(
274276
[
275-
[now - 2.5.days, 'https://example.gov/', false],
276-
[now - 3.0.days, 'https://example.gov/index.html', true],
277-
[now - 3.5.days, 'https://example.gov/subpage', false],
278-
[now - 4.0.days, 'https://example.gov/', true],
279-
[now - 4.5.days, 'https://example.gov/subpage', true],
280-
[now - 5.0.days, 'https://example.gov/', true]
277+
[(now - 2.5.days).round, 'https://example.gov/', false],
278+
[(now - 3.0.days).round, 'https://example.gov/index.html', true],
279+
[(now - 3.5.days).round, 'https://example.gov/subpage', false],
280+
[(now - 4.0.days).round, 'https://example.gov/', true],
281+
[(now - 4.5.days).round, 'https://example.gov/subpage', true],
282+
[(now - 5.0.days).round, 'https://example.gov/', true]
281283
],
282284
page1.versions.pluck(:capture_time, :capture_url, :different)
285+
.map { |row| [row[0].round, row[1], row[2]] }
283286
)
284287
assert_not_predicate(page2, :active?)
285288
end

0 commit comments

Comments
 (0)