Skip to content

Commit

Permalink
[webui] Reintroduce test for not_existing_target
Browse files Browse the repository at this point in the history
Fixed #1269
  • Loading branch information
hennevogel committed Oct 19, 2015
1 parent 965ffe0 commit b602fd3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/api/test/functional/request_controller_test.rb
Expand Up @@ -2477,12 +2477,19 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again
assert_xml_tag(:parent => { tag: 'revision' }, :tag => 'comment', :content => 'DELETE REQUEST')
assert_xml_tag(:parent => { tag: 'revision' }, :tag => 'requestid', :content => id)

# accept the other request, what will fail
login_king
# you can only accept request in state new
post "/request/#{id2}?cmd=changestate&newstate=accepted&force=1"
assert_response 403
assert_xml_tag(:tag => 'status', :attributes => { code: 'post_request_no_permission' })

# you can only accept request in state new and with an existing target
post "/request/#{id2}?cmd=changestate&newstate=new&force=1"
assert_response :success
post "/request/#{id2}?cmd=changestate&newstate=accepted&force=1"
assert_response 404
assert_xml_tag(:tag => 'status', :attributes => { code: 'not_existing_target' })

# decline the request
post "/request/#{id2}?cmd=changestate&newstate=declined"
assert_response :success
Expand Down

0 comments on commit b602fd3

Please sign in to comment.