From d4ff510b03943123b152566b1855171554aaa6b4 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sat, 13 Jul 2024 16:09:08 +0300 Subject: [PATCH] Check that fractional part is present after . in geocoder latlon tests --- test/controllers/geocoder_controller_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/controllers/geocoder_controller_test.rb b/test/controllers/geocoder_controller_test.rb index 4d5d345c3..5b7605321 100644 --- a/test/controllers/geocoder_controller_test.rb +++ b/test/controllers/geocoder_controller_test.rb @@ -418,8 +418,8 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest assert_template :layout => "map" assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name) assert_nil @controller.params[:query] - assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lat]) - assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lon]) + assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lat]) + assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lon]) assert_in_delta lat, @controller.params[:lat].to_f assert_in_delta lon, @controller.params[:lon].to_f @@ -429,8 +429,8 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest assert_template :layout => "xhr" assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name) assert_nil @controller.params[:query] - assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lat]) - assert_match(/^[+-]?\d+(?:\.\d*)?$/, @controller.params[:lon]) + assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lat]) + assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lon]) assert_in_delta lat, @controller.params[:lat].to_f assert_in_delta lon, @controller.params[:lon].to_f end -- 2.39.5