1 require "application_system_test_case"
3 class SiteTest < ApplicationSystemTestCase
4 test "visiting the index" do
7 assert_selector "h1", :text => "OpenStreetMap"
10 test "tooltip shows for Layers button" do
13 assert_no_selector ".tooltip"
14 button = find ".control-layers .control-button"
16 assert_selector ".tooltip", :text => "Layers"
19 test "tooltip shows for Map Key button on Standard layer" do
22 assert_no_selector ".tooltip"
23 button = find ".control-key .control-button"
25 tooltip = find ".tooltip"
26 tooltip.assert_text "Map Key"
27 tooltip.assert_no_text "not available"
30 test "tooltip shows for Map Key button on a layer without a key provided" do
31 visit "/#layers=Y" # assumes that CyclOSM layer has no map key
33 assert_no_selector ".tooltip"
34 button = find ".control-key .control-button"
36 tooltip = find ".tooltip"
37 tooltip.assert_text "Map Key"
38 tooltip.assert_text "not available"
41 test "tooltip shows for query button when zoomed in" do
44 assert_no_selector ".tooltip"
45 button = find ".control-query .control-button"
47 tooltip = find ".tooltip"
48 tooltip.assert_text "Query features"
49 tooltip.assert_no_text "Zoom in"
52 test "tooltip shows for query button when zoomed out" do
55 assert_no_selector ".tooltip"
56 button = find ".control-query .control-button"
58 tooltip = find ".tooltip"
59 tooltip.assert_text "Zoom in to query features"
62 test "tooltip shows for edit button when zoomed out" do
65 assert_no_selector ".tooltip"
66 button = find "#edit_tab"
68 tooltip = find ".tooltip"
69 tooltip.assert_text "Zoom in to edit the map"