Make user creation code in unredact test similar to redact tests
This commit is contained in:
parent
319c9af975
commit
41e93bfb66
2 changed files with 3 additions and 6 deletions
|
@ -289,12 +289,11 @@ module Api
|
|||
# test the unredaction of an old version of a node, while being
|
||||
# authorised as a normal user.
|
||||
def test_unredact_node_normal_user
|
||||
user = create(:user)
|
||||
node = create(:node, :with_history, :version => 2)
|
||||
old_node = node.old_nodes.find_by(:version => 1)
|
||||
redaction = create(:redaction)
|
||||
old_node.redact!(redaction)
|
||||
auth_header = bearer_authorization_header user
|
||||
auth_header = bearer_authorization_header
|
||||
|
||||
post node_version_redact_path(*old_node.id), :headers => auth_header
|
||||
|
||||
|
@ -306,11 +305,10 @@ module Api
|
|||
# test the unredaction of an old version of a node, while being
|
||||
# authorised as a moderator.
|
||||
def test_unredact_node_moderator
|
||||
moderator_user = create(:moderator_user)
|
||||
node = create(:node, :with_history, :version => 2)
|
||||
old_node = node.old_nodes.find_by(:version => 1)
|
||||
old_node.redact!(create(:redaction))
|
||||
auth_header = bearer_authorization_header moderator_user
|
||||
auth_header = bearer_authorization_header create(:moderator_user)
|
||||
|
||||
post node_version_redact_path(*old_node.id), :headers => auth_header
|
||||
|
||||
|
|
|
@ -307,11 +307,10 @@ module Api
|
|||
# test the unredaction of an old version of a way, while being
|
||||
# authorised as a moderator.
|
||||
def test_unredact_way_moderator
|
||||
moderator_user = create(:moderator_user)
|
||||
way = create(:way, :with_history, :version => 2)
|
||||
old_way = way.old_ways.find_by(:version => 1)
|
||||
old_way.redact!(create(:redaction))
|
||||
auth_header = bearer_authorization_header moderator_user
|
||||
auth_header = bearer_authorization_header create(:moderator_user)
|
||||
|
||||
post way_version_redact_path(*old_way.id), :headers => auth_header
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue