Test api changeset comment hide/unhide at legacy routes
This commit is contained in:
parent
3765a7e89e
commit
075f8df94a
1 changed files with 36 additions and 0 deletions
|
@ -114,6 +114,24 @@ module Api
|
||||||
check_successful_response_json(comment, :comment_visible => true)
|
check_successful_response_json(comment, :comment_visible => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_create_at_legacy_route
|
||||||
|
comment = create(:changeset_comment, :visible => false)
|
||||||
|
auth_header = bearer_authorization_header create(:moderator_user), :scopes => %w[write_api]
|
||||||
|
|
||||||
|
post "/api/0.6/changeset/comment/#{comment.id}/unhide", :headers => auth_header
|
||||||
|
|
||||||
|
check_successful_response_xml(comment, :comment_visible => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_create_at_legacy_route_json
|
||||||
|
comment = create(:changeset_comment, :visible => false)
|
||||||
|
auth_header = bearer_authorization_header create(:moderator_user), :scopes => %w[write_api]
|
||||||
|
|
||||||
|
post "/api/0.6/changeset/comment/#{comment.id}/unhide.json", :headers => auth_header
|
||||||
|
|
||||||
|
check_successful_response_json(comment, :comment_visible => true)
|
||||||
|
end
|
||||||
|
|
||||||
def test_destroy_by_unauthorized
|
def test_destroy_by_unauthorized
|
||||||
comment = create(:changeset_comment)
|
comment = create(:changeset_comment)
|
||||||
|
|
||||||
|
@ -187,6 +205,24 @@ module Api
|
||||||
check_successful_response_json(comment, :comment_visible => false)
|
check_successful_response_json(comment, :comment_visible => false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_destroy_at_legacy_route
|
||||||
|
comment = create(:changeset_comment)
|
||||||
|
auth_header = bearer_authorization_header create(:moderator_user), :scopes => %w[write_api]
|
||||||
|
|
||||||
|
post "/api/0.6/changeset/comment/#{comment.id}/hide", :headers => auth_header
|
||||||
|
|
||||||
|
check_successful_response_xml(comment, :comment_visible => false)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_destroy_at_legacy_route_json
|
||||||
|
comment = create(:changeset_comment)
|
||||||
|
auth_header = bearer_authorization_header create(:moderator_user), :scopes => %w[write_api]
|
||||||
|
|
||||||
|
post "/api/0.6/changeset/comment/#{comment.id}/hide.json", :headers => auth_header
|
||||||
|
|
||||||
|
check_successful_response_json(comment, :comment_visible => false)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def check_successful_response_xml(comment, comment_visible:)
|
def check_successful_response_xml(comment, comment_visible:)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue