4 class RedactionTest < ActiveSupport::TestCase
5 def test_cannot_redact_current
8 assert_equal(false, n.redacted?, "Expected node to not be redacted already.")
9 assert_raise(OSM::APICannotRedactError) do
14 def test_cannot_redact_current_via_old
15 node = create(:node, :with_history)
16 node_v1 = node.old_nodes.find_by(:version => 1)
17 r = create(:redaction)
18 assert_equal(false, node_v1.redacted?, "Expected node to not be redacted already.")
19 assert_raise(OSM::APICannotRedactError) do
24 def test_can_redact_old
25 node = create(:node, :with_history, :version => 2)
26 node_v1 = node.old_nodes.find_by(:version => 1)
27 node_v2 = node.old_nodes.find_by(:version => 2)
28 r = create(:redaction)
30 assert_equal(false, node_v1.redacted?, "Expected node to not be redacted already.")
31 assert_nothing_raised do
34 assert_equal(true, node_v1.redacted?, "Expected node version 1 to be redacted after redact! call.")
35 assert_equal(false, node_v2.redacted?, "Expected node version 2 to not be redacted after redact! call.")