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