3 class OldNodesControllerTest < ActionDispatch::IntegrationTest
6 { :path => "/node/1/history/2", :method => :get },
7 { :controller => "old_nodes", :action => "show", :id => "1", :version => "2" }
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 assert_select "h4", /^Version/ do
18 assert_select "a[href='#{old_node_path node, 1}']", :count => 0
20 assert_select "a[href='#{node_version_path node, 1}']", :count => 1
24 node = create(:node, :with_history, :deleted, :version => 2)
25 node_v1 = node.old_nodes.find_by(:version => 1)
26 node_v1.redact!(create(:redaction))
27 get old_node_path(node, 1)
28 assert_response :success
29 assert_template "old_nodes/show"
30 assert_template :layout => "map"
31 assert_select "a[href='#{old_node_path node, 1}']", :count => 0
32 assert_select "a[href='#{node_version_path node, 1}']", :count => 0
36 get old_node_path(0, 0)
37 assert_response :not_found
38 assert_template "old_nodes/not_found"
39 assert_template :layout => "map"
40 assert_select "#sidebar_content", /node #0 version 0 could not be found/