X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/05beafb2f336a7ce6d22179b1270c299e6d52632..3fa3658efa4c528c499e72abf7464748cc6c7fb8:/test/controllers/browse_controller_test.rb diff --git a/test/controllers/browse_controller_test.rb b/test/controllers/browse_controller_test.rb index 567fc0576..12262b224 100644 --- a/test/controllers/browse_controller_test.rb +++ b/test/controllers/browse_controller_test.rb @@ -62,11 +62,11 @@ class BrowseControllerTest < ActionController::TestCase end def test_read_node - browse_check "node", nodes(:visible_node).node_id, "browse/feature" + browse_check "node", create(:node).id, "browse/feature" end def test_read_node_history - browse_check "node_history", nodes(:visible_node).node_id, "browse/history" + browse_check "node_history", create(:node, :with_history).id, "browse/history" end def test_read_changeset @@ -135,7 +135,11 @@ class BrowseControllerTest < ActionController::TestCase # then please make it more easily (and robustly) testable! ## def test_redacted_node - get :node, :id => current_nodes(:redacted_node).id + node = create(:node, :with_history, :deleted, :version => 2) + node_v1 = node.old_nodes.find_by(:version => 1) + node_v1.redact!(create(:redaction)) + + get :node, :id => node.id assert_response :success assert_template "feature" @@ -147,7 +151,11 @@ class BrowseControllerTest < ActionController::TestCase end def test_redacted_node_history - get :node_history, :id => nodes(:redacted_node_redacted_version).node_id + node = create(:node, :with_history, :deleted, :version => 2) + node_v1 = node.old_nodes.find_by(:version => 1) + node_v1.redact!(create(:redaction)) + + get :node_history, :id => node.id assert_response :success assert_template "browse/history"