]> git.openstreetmap.org Git - rails.git/blob - test/controllers/old_nodes_controller_test.rb
Add node version pages
[rails.git] / test / controllers / old_nodes_controller_test.rb
1 require "test_helper"
2
3 class OldNodesControllerTest < ActionDispatch::IntegrationTest
4   def test_routes
5     assert_routing(
6       { :path => "/node/1/history/2", :method => :get },
7       { :controller => "old_nodes", :action => "show", :id => "1", :version => "2" }
8     )
9   end
10
11   def test_visible
12     node = create(:node, :with_history)
13     get old_node_path(node, 1)
14     assert_response :success
15     assert_template "old_nodes/show"
16     assert_template :layout => "map"
17   end
18
19   def test_not_found
20     get old_node_path(0, 0)
21     assert_response :not_found
22     assert_template "old_nodes/not_found"
23     assert_template :layout => "map"
24     assert_select "#sidebar_content", /node #0 version 0 could not be found/
25   end
26 end