]> git.openstreetmap.org Git - rails.git/blob - test/system/search_test.rb
Masked off reporting as unused various keys
[rails.git] / test / system / search_test.rb
1 require "application_system_test_case"
2
3 class SearchTest < ApplicationSystemTestCase
4   test "click on 'where is this' sets search input value" do
5     stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?})
6       .to_return(:status => 404)
7
8     visit "/#map=7/1.234/6.789"
9
10     assert_field "Search", :with => ""
11     click_on "Where is this?"
12     assert_field "Search", :with => "1.234, 6.789"
13   end
14
15   test "query search link sets search input value" do
16     stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?})
17       .to_return(:status => 404)
18
19     visit search_path(:query => "2.341, 7.896")
20
21     assert_field "Search", :with => "2.341, 7.896"
22   end
23
24   test "latlon search link sets search input value" do
25     stub_request(:get, %r{^https://nominatim\.openstreetmap\.org/reverse\?})
26       .to_return(:status => 404)
27
28     visit search_path(:lat => "4.321", :lon => "9.876")
29
30     assert_field "Search", :with => "4.321, 9.876"
31   end
32 end