3 class OldWaysControllerTest < ActionDispatch::IntegrationTest
6 { :path => "/way/1/history/2", :method => :get },
7 { :controller => "old_ways", :action => "show", :id => "1", :version => "2" }
12 way = create(:way, :with_history)
13 get old_way_path(way, 1)
14 assert_response :success
15 assert_template "old_ways/show"
16 assert_template :layout => "map"
17 assert_select "h4", /^Version/ do
18 assert_select "a[href='#{old_way_path way, 1}']", :count => 0
22 def test_visible_with_shared_nodes
23 node = create(:node, :with_history)
24 way = create(:way, :with_history)
25 create(:way_node, :way => way, :node => node)
26 create(:old_way_node, :old_way => way.old_ways.first, :node => node)
27 sharing_way = create(:way, :with_history)
28 create(:way_node, :way => sharing_way, :node => node)
29 create(:old_way_node, :old_way => sharing_way.old_ways.first, :node => node)
30 get old_way_path(way, 1)
31 assert_response :success
32 assert_template "old_ways/show"
33 assert_template :layout => "map"
37 get old_way_path(0, 0)
38 assert_response :not_found
39 assert_template "old_ways/not_found"
40 assert_template :layout => "map"
41 assert_select "#sidebar_content", /way #0 version 0 could not be found/