+ node = create(:node)
+ browse_check :node_path, node.id, "browse/feature"
+ assert_select "h4", /^Version/ do
+ assert_select "a[href='#{old_node_path node, 1}']", :text => "1", :count => 1
+ end
+ assert_select ".secondary-actions a[href='#{api_node_path node}']", :count => 1
+ assert_select ".secondary-actions a[href='#{node_history_path node}']", :count => 1
+ assert_select ".secondary-actions a[href='#{old_node_path node, 1}']", :count => 0
+ end
+
+ def test_multiple_version_node_links
+ node = create(:node, :with_history, :version => 2)
+ browse_check :node_path, node.id, "browse/feature"
+ assert_select ".secondary-actions a[href='#{node_history_path node}']", :count => 1
+ assert_select ".secondary-actions a[href='#{old_node_path node, 1}']", :count => 1
+ assert_select ".secondary-actions a[href='#{old_node_path node, 2}']", :count => 1
+ end
+
+ def test_read_deleted_node
+ node = create(:node, :visible => false)
+ browse_check :node_path, node.id, "browse/feature"
+ assert_select "h4", /^Version/ do
+ assert_select "a[href='#{old_node_path node, 1}']", :text => "1", :count => 1
+ end
+ assert_select "a[href='#{api_node_path node}']", :count => 0