3 class WaysControllerTest < ActionDispatch::IntegrationTest
5 # test all routes which lead to this controller
8 { :path => "/way/1", :method => :get },
9 { :controller => "ways", :action => "show", :id => "1" }
15 sidebar_browse_check :way_path, way.id, "browse/feature"
16 assert_select "h4", /^Version/ do
17 assert_select "a[href='#{old_way_path way, 1}']", :text => "1", :count => 1
19 assert_select ".secondary-actions a[href='#{api_way_path way}']", :count => 1
20 assert_select ".secondary-actions a[href='#{way_history_path way}']", :count => 1
21 assert_select ".secondary-actions a[href='#{old_way_path way, 1}']", :count => 0
24 def test_show_multiple_versions
25 way = create(:way, :with_history, :version => 2)
26 sidebar_browse_check :way_path, way.id, "browse/feature"
27 assert_select ".secondary-actions a[href='#{way_history_path way}']", :count => 1
28 assert_select ".secondary-actions a[href='#{old_way_path way, 1}']", :count => 1
29 assert_select ".secondary-actions a[href='#{old_way_path way, 2}']", :count => 1