]> git.openstreetmap.org Git - rails.git/blob - test/controllers/ways_controller_test.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / controllers / ways_controller_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 class WaysControllerTest < ActionDispatch::IntegrationTest
6   ##
7   # test all routes which lead to this controller
8   def test_routes
9     assert_routing(
10       { :path => "/way/1", :method => :get },
11       { :controller => "ways", :action => "show", :id => "1" }
12     )
13   end
14
15   def test_show
16     way = create(:way)
17     sidebar_browse_check :way_path, way.id, "elements/show"
18   end
19
20   def test_show_timeout
21     way = create(:way)
22     with_settings(:web_timeout => -1) do
23       get way_path(way)
24     end
25     assert_response :error
26     assert_template :layout => "map"
27     assert_dom "h2", "Timeout Error"
28     assert_dom "p", /#{Regexp.quote("the way with the id #{way.id}")}/
29   end
30 end