@@ -270,16 +270,19 @@ class PageTest < ActiveSupport::TestCase
270
270
assert_equal ( [ 'maintainer1' , 'maintainer2' , 'maintainer3' ] , page1 . maintainers . pluck ( :name ) )
271
271
assert_equal ( 3 , page1 . urls . count , 'Page1 has all the unique URLs from the pages' )
272
272
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.
273
275
assert_equal (
274
276
[
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 ]
281
283
] ,
282
284
page1 . versions . pluck ( :capture_time , :capture_url , :different )
285
+ . map { |row | [ row [ 0 ] . round , row [ 1 ] , row [ 2 ] ] }
283
286
)
284
287
assert_not_predicate ( page2 , :active? )
285
288
end
0 commit comments