From: Tom Hughes Date: Wed, 8 Mar 2023 17:07:34 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/3963' X-Git-Tag: live~1349 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/07e57daf2b2d80c5034bdc57998a95e61d54ceea?hp=2fac7a43842f186a507a176ee40a0ed5d25a3da4 Merge remote-tracking branch 'upstream/pull/3963' --- diff --git a/Gemfile b/Gemfile index 8a5d4432a..c25240f9f 100644 --- a/Gemfile +++ b/Gemfile @@ -137,6 +137,7 @@ group :development do gem "better_errors" gem "binding_of_caller" gem "debug_inspector" + gem "i18n-tasks" gem "listen" gem "vendorer" end diff --git a/Gemfile.lock b/Gemfile.lock index c94a42934..5d999ed00 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -232,12 +232,24 @@ GEM activesupport (>= 5.0) hashdiff (1.0.1) hashie (5.0.0) + highline (2.1.0) htmlentities (4.3.4) http_accept_language (2.1.1) i18n (1.12.0) concurrent-ruby (~> 1.0) i18n-js (3.9.2) i18n (>= 0.6.6) + i18n-tasks (1.0.12) + activesupport (>= 4.0.2) + ast (>= 2.1.0) + better_html (>= 1.0, < 3.0) + erubi + highline (>= 2.0.0) + i18n + parser (>= 2.2.3.0) + rails-i18n + rainbow (>= 2.2.2, < 4.0) + terminal-table (>= 1.5.1) image_optim (0.31.3) exifr (~> 1.2, >= 1.2.2) fspath (~> 3.0) @@ -488,6 +500,8 @@ GEM sprockets (>= 3.0.0) strong_migrations (1.4.3) activerecord (>= 5.2) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) terser (1.1.14) execjs (>= 0.3.0, < 3) thor (1.2.1) @@ -552,6 +566,7 @@ DEPENDENCIES htmlentities http_accept_language (~> 2.1.1) i18n-js (~> 3.9.2) + i18n-tasks image_optim_rails image_processing jbuilder (~> 2.7) diff --git a/app/assets/javascripts/index/search.js b/app/assets/javascripts/index/search.js index 10750b5b7..b7bca1d2a 100644 --- a/app/assets/javascripts/index/search.js +++ b/app/assets/javascripts/index/search.js @@ -129,17 +129,21 @@ OSM.Search = function (map) { page.load = function () { $(".search_results_entry").each(function (index) { - var entry = $(this); + var entry = $(this), + csrf_param = $("meta[name=csrf-param]").attr("content"), + csrf_token = $("meta[name=csrf-token]").attr("content"), + params = { + zoom: map.getZoom(), + minlon: map.getBounds().getWest(), + minlat: map.getBounds().getSouth(), + maxlon: map.getBounds().getEast(), + maxlat: map.getBounds().getNorth() + }; + params[csrf_param] = csrf_token; $.ajax({ url: entry.data("href"), - method: "GET", - data: { - zoom: map.getZoom(), - minlon: map.getBounds().getWest(), - minlat: map.getBounds().getSouth(), - maxlon: map.getBounds().getEast(), - maxlat: map.getBounds().getNorth() - }, + method: "POST", + data: params, success: function (html) { entry.html(html); // go to first result of first geocoder diff --git a/app/views/confirmations/confirm.html.erb b/app/views/confirmations/confirm.html.erb index 7350f8628..879fb8f33 100644 --- a/app/views/confirmations/confirm.html.erb +++ b/app/views/confirmations/confirm.html.erb @@ -27,6 +27,8 @@ -

<%= t ".reconfirm_html", - :reconfirm => url_for(:action => "confirm_resend") %>

+

+ <%= t ".resend_html", + :reconfirm_link => link_to(t(".click_here"), url_for(:action => "confirm_resend")) %> +

<% end %> diff --git a/app/views/shared/_markdown_help.html.erb b/app/views/shared/_markdown_help.html.erb index 5bd8c4955..9097c9d91 100644 --- a/app/views/shared/_markdown_help.html.erb +++ b/app/views/shared/_markdown_help.html.erb @@ -1,4 +1,6 @@ -
<%= t ".title_html" %>
+
+ <%= t ".heading_html", :kramdown_link => link_to(t(".kramdown"), t(".kramdown_url")) %> +
<%= t ".headings" %>
# <%= t ".heading" %>
diff --git a/app/views/site/_potlatch.html.erb b/app/views/site/_potlatch.html.erb index 790a3bf5d..909a4cb41 100644 --- a/app/views/site/_potlatch.html.erb +++ b/app/views/site/_potlatch.html.erb @@ -1,5 +1,5 @@

<%= t ".removed" %>

-

<%= t ".desktop_html" %>

-

<%= t ".id_html", :settings_url => preferences_path %>

+

<%= t ".desktop_application_html", :download_link => link_to(t(".download"), t(".download_url")) %>

+

<%= t ".id_editor_html", :change_preferences_link => link_to(t(".change_preferences"), preferences_path) %>

diff --git a/app/views/site/communities.html.erb b/app/views/site/communities.html.erb index c21406683..21b5c235c 100644 --- a/app/views/site/communities.html.erb +++ b/app/views/site/communities.html.erb @@ -20,4 +20,5 @@

<%= t ".other_groups.title" %>

-

<%= t ".other_groups.about_html" %>

+

<%= t ".other_groups.other_groups_html", :communities_wiki_link => link_to(t(".other_groups.communities_wiki"), + t(".other_groups.communities_wiki_url")) %> diff --git a/app/views/site/fixthemap.html.erb b/app/views/site/fixthemap.html.erb index fe6cf22c5..ab8684116 100644 --- a/app/views/site/fixthemap.html.erb +++ b/app/views/site/fixthemap.html.erb @@ -27,6 +27,9 @@

<%= t ".other_concerns.title" %>

-

<%= t ".other_concerns.explanation_html" %>

+

+ <%= t ".other_concerns.concerns_html", :copyright_link => link_to(t(".other_concerns.copyright"), copyright_path), + :working_group_link => link_to(t(".other_concerns.working_group"), t(".other_concerns.working_group_url")) %> +

<%= render "any_questions" %> diff --git a/app/views/users/terms.html.erb b/app/views/users/terms.html.erb index f16166702..e2ece8f1a 100644 --- a/app/views/users/terms.html.erb +++ b/app/views/users/terms.html.erb @@ -36,9 +36,11 @@

- <%= t ".guidance_html", - :summary => "https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary", - :translations => "https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations" %> + <%= t ".guidance_info_html", + :readable_summary_link => link_to(t(".readable_summary"), + "https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary"), + :informal_translations_link => link_to(t(".informal_translations"), + "https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations") %>

diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml new file mode 100644 index 000000000..60f8a09df --- /dev/null +++ b/config/i18n-tasks.yml @@ -0,0 +1,160 @@ +# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks + +# The "main" locale. +base_locale: en +## All available locales are inferred from the data by default. Alternatively, specify them explicitly: +# locales: [es, fr] +## Reporting locale, default: en. Available: en, ru. +# internal_locale: en + +# Read and write translations. +data: + ## Translations are read from the file system. Supported format: YAML, JSON. + ## Provide a custom adapter: + # adapter: I18n::Tasks::Data::FileSystem + + # Locale files or `File.find` patterns where translations are read from: + read: + ## Default: + - config/locales/en.yml + ## More files: + # - config/locales/**/*.%{locale}.yml + + # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: + # `i18n-tasks normalize -p` will force move the keys according to these rules + write: + ## For example, write devise and simple form keys to their respective files: + # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml'] + ## Catch-all default: + # - config/locales/%{locale}.yml + + # External locale data (e.g. gems). + # This data is not considered unused and is never written to. + external: + ## Example (replace %#= with %=): + # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml" + + ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class. + # router: conservative_router + + yaml: + write: + # do not wrap lines at 80 characters + line_width: -1 + + ## Pretty-print JSON: + # json: + # write: + # indent: ' ' + # space: ' ' + # object_nl: "\n" + # array_nl: "\n" + +# Find translate calls +search: + ## Paths or `File.find` patterns to search in: + # paths: + # - app/ + + ## Root directories for relative keys resolution. + # relative_roots: + # - app/controllers + # - app/helpers + # - app/mailers + # - app/presenters + # - app/views + + ## Directories where method names which should not be part of a relative key resolution. + # By default, if a relative translation is used inside a method, the name of the method will be considered part of the resolved key. + # Directories listed here will not consider the name of the method part of the resolved key + # + # relative_exclude_method_name_paths: + # - + + ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting: + ## *.jpg *.jpeg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less + ## *.yml *.json *.zip *.tar.gz *.swf *.flv *.mp3 *.wav *.flac *.webm *.mp4 *.ogg *.opus *.webp *.map *.xlsx + exclude: + - app/assets/images + - app/assets/fonts + - app/assets/videos + - app/assets/builds + + ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`: + ## If specified, this settings takes priority over `exclude`, but `exclude` still applies. + # only: ["*.rb", "*.html.slim"] + + ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`. + strict: false + + ## Allows adding ast_matchers for finding translations using the AST-scanners + ## The available matchers are: + ## - RailsModelMatcher + ## Matches ActiveRecord translations like + ## User.human_attribute_name(:email) and User.model_name.human + ## + ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`. + <%# I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher') %> + + ## Multiple scanners can be used. Their results are merged. + ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well. + ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example + +## Translation Services +# translation: +# # Google Translate +# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate +# google_translate_api_key: "AbC-dEf5" +# # DeepL Pro Translate +# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro +# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A" +# # deepl_host: "https://api.deepl.com" +# # deepl_version: "v2" + +## Do not consider these keys missing: +# ignore_missing: +# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}' +# - '{devise,simple_form}.*' + +## Consider these keys used: +ignore_unused: + - 'geocoder.search_osm_nominatim.prefix.*' + - 'javascripts.*' + - 'activerecord.attributes.*' + - 'activerecord.models.*' + - 'activerecord.help.*' + - 'helpers.submit.*' + - 'datetime.distance_in_words_ago.*' + - 'reports.new.categories.*' # double interpolation in reports_helper +# - '{devise,kaminari,will_paginate}.*' +# - 'simple_form.{yes,no}' +# - 'simple_form.{placeholders,hints,labels}.*' +# - 'simple_form.{error_notification,required}.:' + +## Exclude these keys from the `i18n-tasks eq-base' report: +# ignore_eq_base: +# all: +# - common.ok +# fr,es: +# - common.brand + +## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report: +# ignore_inconsistent_interpolations: +# - 'activerecord.attributes.*' + +## Ignore these keys completely: +# ignore: +# - kaminari.* + +## Sometimes, it isn't possible for i18n-tasks to match the key correctly, +## e.g. in case of a relative key defined in a helper method. +## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# only: %w(*.html.haml *.html.slim), +# patterns: [['= title\b', '.page_title']] %> +# +# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %> diff --git a/config/locales/en.yml b/config/locales/en.yml index fc01c22ae..ca1d313c8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -52,7 +52,6 @@ en: message: "Message" node: "Node" node_tag: "Node Tag" - notifier: "Notifier" old_node: "Old Node" old_node_tag: "Old Node Tag" old_relation: "Old Relation" @@ -1399,10 +1398,6 @@ en: ignored: Ignored open: Open resolved: Resolved - update: - new_report: Your report has been registered successfully - successful_update: Your report has been updated successfully - provide_details: Please provide the required details show: title: "%{status} Issue #%{issue_id}" reports: @@ -1485,10 +1480,8 @@ en: home: Go to Home Location logout: Log Out log_in: Log In - log_in_tooltip: Log in with an existing account sign_up: Sign Up start_mapping: Start Mapping - sign_up_tooltip: Create an account for editing edit: Edit history: History export: Export @@ -1520,8 +1513,6 @@ en: community: Community community_blogs: "Community Blogs" community_blogs_title: "Blogs from members of the OpenStreetMap community" - foundation: Foundation - foundation_title: The OpenStreetMap Foundation make_a_donation: title: Support OpenStreetMap with a monetary donation text: Make a Donation @@ -1636,7 +1627,8 @@ en: success: "Confirmed your account, thanks for signing up!" already active: "This account has already been confirmed." unknown token: "That confirmation code has expired or does not exist." - reconfirm_html: "If you need us to resend the confirmation email, click here." + resend_html: "If you need us to resend the confirmation email, %{reconfirm_link}." + click_here: click here confirm_resend: failure: "User %{name} not found." confirm_email: @@ -1674,8 +1666,6 @@ en: new: title: "Send message" send_message_to_html: "Send a new message to %{name}" - subject: "Subject" - body: "Body" back_to_inbox: "Back to inbox" create: message_sent: "Message sent" @@ -1700,14 +1690,10 @@ en: wrong_user: "You are logged in as `%{user}' but the message you have asked to reply to was not sent to that user. Please login as the correct user in order to reply." show: title: "Read message" - from: "From" - subject: "Subject" - date: "Date" reply_button: "Reply" unread_button: "Mark as unread" destroy_button: "Delete" back: "Back" - to: "To" wrong_user: "You are logged in as `%{user}' but the message you have asked to read was not sent by or to that user. Please login as the correct user in order to read it." sent_message_summary: destroy_button: "Delete" @@ -1779,13 +1765,8 @@ en: lost password link: "Lost your password?" login_button: "Login" register now: Register now - with username: "Already have an OpenStreetMap account? Please login with your username and password:" with external: "Alternatively, use a third party to login:" - new to osm: New to OpenStreetMap? - to make changes: To make changes to the OpenStreetMap data, you must have an account. - create account minute: Create an account. It only takes a minute. no account: Don't have an account? - account not active: "Sorry, your account is not active yet.
Please use the link in the account confirmation email to activate your account, or request a new confirmation email." auth failure: "Sorry, could not log in with those details." openid_logo_alt: "Log in with an OpenID" auth_providers: @@ -1823,7 +1804,9 @@ en: support: support shared: markdown_help: - title_html: Parsed with kramdown + heading_html: Parsed with %{kramdown_link} + kramdown_url: https://kramdown.gettalong.org/quickref.html + kramdown: kramdown headings: Headings heading: Heading subheading: Subheading @@ -2005,7 +1988,7 @@ en: contributors_gb_html: | United Kingdom: Contains Ordnance Survey data © Crown copyright and database right - 2010-19. + 2010-2023. contributors_footer_1_html: | For further details of these, and other sources that have been used to help improve OpenStreetMap, please see the copyright page for more legal information, or contact the appropriate - OSMF working group. + %{copyright_link} for more legal information, or contact the appropriate %{working_group_link}. + copyright: copyright page + working_group: OSMF working group + working_group_url: https://wiki.osmfoundation.org/wiki/Working_Groups help: title: Getting Help introduction: | @@ -2158,8 +2140,11 @@ en: description: Browse the wiki for in-depth OpenStreetMap documentation. potlatch: removed: Your default OpenStreetMap editor is set as Potlatch. Because Adobe Flash Player has been withdrawn, Potlatch is no longer available to use in a web browser. - desktop_html: You can still use Potlatch by downloading the desktop application for Mac and Windows. - id_html: Alternatively, you can set your default editor to iD, which runs in your web browser as Potlatch formerly did. Change your preferences here. + desktop_application_html: You can still use Potlatch by %{download_link}. + download: downloading the desktop application for Mac and Windows + download_url: https://www.systemed.net/potlatch/ + id_editor_html: Alternatively, you can set your default editor to iD, which runs in your web browser as Potlatch formerly did. %{change_preferences_link}. + change_preferences: Change your preferences here any_questions: title: Any questions? paragraph_1_html: | @@ -2324,11 +2309,12 @@ en: The following communities are formally established as Local Chapters: other_groups: title: Other Groups - about_html: | + other_groups_html: | There is no need to formally establish a group to the same extent as the Local Chapters. Indeed many groups exist very sucessfully as an informal gathering of people or as a - community group. Anyone can set up or join these. Read more on the - Communities wiki page. + community group. Anyone can set up or join these. Read more on the %{communities_wiki_link}. + communities_wiki: Communities wiki page + communities_wiki_url: https://wiki.openstreetmap.org/wiki/User_group traces: visibility: private: "Private (only shared as anonymous, unordered points)" @@ -2575,9 +2561,6 @@ en: header: Free and editable paragraph_1: Unlike other maps, OpenStreetMap is completely created by people like you, and it's free for anyone to fix, update, download and use. paragraph_2: Sign up to get started contributing. We'll send an email to confirm your account. - email address: "Email Address:" - confirm email address: "Confirm Email Address:" - display name: "Display Name:" display name description: "Your publicly displayed username. You can change this later in the preferences." external auth: "Third Party Authentication:" use external auth: "Alternatively, use a third party to login" @@ -2596,7 +2579,9 @@ en: consider_pd: "In addition to the above, I consider my contributions to be in the Public Domain" consider_pd_why: "what's this?" consider_pd_why_url: https://wiki.osmfoundation.org/wiki/Licence_and_Legal_FAQ/Why_would_I_want_my_contributions_to_be_public_domain - guidance_html: 'Information to help understand these terms: a human readable summary and some informal translations' + guidance_info_html: "Information to help understand these terms: a %{readable_summary_link} and some %{informal_translations_link}" + readable_summary: human readable summary + informal_translations: informal translations continue: Continue declined: "https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined" decline: "Decline" @@ -2617,7 +2602,6 @@ en: deleted: "deleted" show: my diary: My Diary - new diary entry: new diary entry my edits: My Edits my traces: My Traces my notes: My Notes @@ -2646,8 +2630,6 @@ en: created from: "Created from:" status: "Status:" spam score: "Spam Score:" - description: Description - user location: User location role: administrator: "This user is an administrator" moderator: "This user is a moderator" @@ -2662,7 +2644,6 @@ en: comments: "Comments" create_block: "Block this User" activate_user: "Activate this User" - deactivate_user: "Deactivate this User" confirm_user: "Confirm this User" unconfirm_user: "Unconfirm this User" unsuspend_user: "Unsuspend this User" @@ -2671,8 +2652,6 @@ en: delete_user: "Delete this User" confirm: "Confirm" report: Report this User - set_home: - flash success: "Home location saved successfully" go_public: flash success: "All your edits are now public, and you are now allowed to edit." index: @@ -2692,7 +2671,6 @@ en: support: support automatically_suspended: Sorry, your account has been automatically suspended due to suspicious activity. contact_support_html: This decision will be reviewed by an administrator shortly, or you may contact %{support_link} if you wish to discuss this. - support: support auth_failure: connection_failed: Connection to authentication provider failed invalid_credentials: Invalid authentication credentials @@ -2738,8 +2716,6 @@ en: title: "Creating block on %{name}" heading_html: "Creating block on %{name}" period: "How long, starting now, the user will be blocked from the API for." - tried_contacting: "I have contacted the user and asked them to stop." - tried_waiting: "I have given a reasonable amount of time for the user to respond to those communications." back: "View all blocks" edit: title: "Editing block on %{name}" @@ -2751,8 +2727,6 @@ en: block_expired: "The block has already expired and cannot be edited." block_period: "The blocking period must be one of the values selectable in the drop-down list." create: - try_contacting: "Please try contacting the user before blocking them and giving them a reasonable time to respond." - try_waiting: "Please try giving the user a reasonable time to respond before blocking them." flash: "Created a block on user %{name}." update: only_creator_can_edit: "Only the moderator who created this block can edit it." diff --git a/config/routes.rb b/config/routes.rb index c0fbf2020..04a6908df 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -260,9 +260,9 @@ OpenStreetMap::Application.routes.draw do # geocoder get "/search" => "geocoder#search" - get "/geocoder/search_latlon" => "geocoder#search_latlon" - get "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim" - get "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse" + post "/geocoder/search_latlon" => "geocoder#search_latlon" + post "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim" + post "/geocoder/search_osm_nominatim_reverse" => "geocoder#search_osm_nominatim_reverse" # directions get "/directions" => "directions#search" diff --git a/test/controllers/geocoder_controller_test.rb b/test/controllers/geocoder_controller_test.rb index 0d3b80e9e..dd740e570 100644 --- a/test/controllers/geocoder_controller_test.rb +++ b/test/controllers/geocoder_controller_test.rb @@ -9,15 +9,15 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest { :controller => "geocoder", :action => "search" } ) assert_routing( - { :path => "/geocoder/search_latlon", :method => :get }, + { :path => "/geocoder/search_latlon", :method => :post }, { :controller => "geocoder", :action => "search_latlon" } ) assert_routing( - { :path => "/geocoder/search_osm_nominatim", :method => :get }, + { :path => "/geocoder/search_osm_nominatim", :method => :post }, { :controller => "geocoder", :action => "search_osm_nominatim" } ) assert_routing( - { :path => "/geocoder/search_osm_nominatim_reverse", :method => :get }, + { :path => "/geocoder/search_osm_nominatim_reverse", :method => :post }, { :controller => "geocoder", :action => "search_osm_nominatim_reverse" } ) end @@ -263,43 +263,43 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest ## # Test the builtin latitude+longitude search def test_search_latlon - get geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16), :xhr => true + post geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16), :xhr => true results_check :name => "1.23, 4.56", :lat => 1.23, :lon => 4.56, :zoom => 16 - get geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16), :xhr => true + post geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16), :xhr => true results_check_error "Latitude -91.23 out of range" - get geocoder_search_latlon_path(:lat => 91.23, :lon => 4.56, :zoom => 16), :xhr => true + post geocoder_search_latlon_path(:lat => 91.23, :lon => 4.56, :zoom => 16), :xhr => true results_check_error "Latitude 91.23 out of range" - get geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16), :xhr => true + post geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16), :xhr => true results_check_error "Longitude -180.23 out of range" - get geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16), :xhr => true + post geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16), :xhr => true results_check_error "Longitude 180.23 out of range" end def test_search_latlon_digits - get geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true + post geocoder_search_latlon_path(:lat => 1.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true results_check({ :name => "1.23, 4.56", :lat => 1.23, :lon => 4.56, :zoom => 16 }, { :name => "4.56, 1.23", :lat => 4.56, :lon => 1.23, :zoom => 16 }) - get geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true + post geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true results_check :name => "4.56, -91.23", :lat => 4.56, :lon => -91.23, :zoom => 16 - get geocoder_search_latlon_path(:lat => -1.23, :lon => 170.23, :zoom => 16, :latlon_digits => true), :xhr => true + post geocoder_search_latlon_path(:lat => -1.23, :lon => 170.23, :zoom => 16, :latlon_digits => true), :xhr => true results_check :name => "-1.23, 170.23", :lat => -1.23, :lon => 170.23, :zoom => 16 - get geocoder_search_latlon_path(:lat => 91.23, :lon => 94.56, :zoom => 16, :latlon_digits => true), :xhr => true + post geocoder_search_latlon_path(:lat => 91.23, :lon => 94.56, :zoom => 16, :latlon_digits => true), :xhr => true results_check_error "Latitude or longitude are out of range" - get geocoder_search_latlon_path(:lat => -91.23, :lon => -94.56, :zoom => 16, :latlon_digits => true), :xhr => true + post geocoder_search_latlon_path(:lat => -91.23, :lon => -94.56, :zoom => 16, :latlon_digits => true), :xhr => true results_check_error "Latitude or longitude are out of range" - get geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16, :latlon_digits => true), :xhr => true + post geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16, :latlon_digits => true), :xhr => true results_check_error "Latitude or longitude are out of range" - get geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16, :latlon_digits => true), :xhr => true + post geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16, :latlon_digits => true), :xhr => true results_check_error "Latitude or longitude are out of range" end @@ -307,17 +307,17 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest # Test the nominatim forward search def test_search_osm_nominatim with_http_stubs "nominatim" do - get geocoder_search_osm_nominatim_path(:query => "Hoddesdon", :zoom => 10, - :minlon => -0.559, :minlat => 51.217, - :maxlon => 0.836, :maxlat => 51.766), :xhr => true + post geocoder_search_osm_nominatim_path(:query => "Hoddesdon", :zoom => 10, + :minlon => -0.559, :minlat => 51.217, + :maxlon => 0.836, :maxlat => 51.766), :xhr => true results_check "name" => "Hoddesdon, Hertfordshire, East of England, England, United Kingdom", "min-lat" => 51.7216709, "max-lat" => 51.8016709, "min-lon" => -0.0512898, "max-lon" => 0.0287102, "type" => "node", "id" => 18007599 - get geocoder_search_osm_nominatim_path(:query => "Broxbourne", :zoom => 10, - :minlon => -0.559, :minlat => 51.217, - :maxlon => 0.836, :maxlat => 51.766), :xhr => true + post geocoder_search_osm_nominatim_path(:query => "Broxbourne", :zoom => 10, + :minlon => -0.559, :minlat => 51.217, + :maxlon => 0.836, :maxlat => 51.766), :xhr => true results_check({ "prefix" => "Suburb", "name" => "Broxbourne, Hertfordshire, East of England, England, United Kingdom", "min-lat" => 51.7265723, "max-lat" => 51.7665723, @@ -340,17 +340,17 @@ class GeocoderControllerTest < ActionDispatch::IntegrationTest # Test the nominatim reverse search def test_search_osm_nominatim_reverse with_http_stubs "nominatim" do - get geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 15), :xhr => true + post geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 15), :xhr => true results_check :name => "Broxbourne, Hertfordshire, East of England, England, United Kingdom", :lat => 51.7465723, :lon => -0.0190782, :type => "node", :id => 28825933, :zoom => 15 - get geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 17), :xhr => true + post geocoder_search_osm_nominatim_reverse_path(:lat => 51.7632, :lon => -0.0076, :zoom => 17), :xhr => true results_check :name => "Dinant Link Road, Broxbourne, Hertfordshire, East of England, England, EN11 8HX, United Kingdom", :lat => 51.7634883, :lon => -0.0088373, :type => "way", :id => 3489841, :zoom => 17 - get geocoder_search_osm_nominatim_reverse_path(:lat => 13.7709, :lon => 100.50507, :zoom => 19), :xhr => true + post geocoder_search_osm_nominatim_reverse_path(:lat => 13.7709, :lon => 100.50507, :zoom => 19), :xhr => true results_check :name => "MM Steak&Grill, ถนนศรีอยุธยา, บางขุนพรหม, กรุงเทพมหานคร, เขตดุสิต, กรุงเทพมหานคร, 10300, ประเทศไทย", :lat => 13.7708691, :lon => 100.505073233221, :type => "way", :id => 542901374, :zoom => 19