Skip to content

Commit

Permalink
[ci] test also "updatelink" for new packages
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed May 12, 2015
1 parent 37ef809 commit 46b82c7
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,6 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again
<source project='home:tom:branches:BaseDistro2.0:LinkedUpdateProject' package='pack2' />
<target project='DummY' package='pack2' />
<options>
<sourceupdate>cleanup</sourceupdate>
<updatelink>true</updatelink>
</options>
</action>
Expand Down Expand Up @@ -2287,13 +2286,51 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again
assert_response :success
assert_xml_tag(:parent => { tag: 'file', attributes: { state: 'changed' } }, :tag => 'new', :attributes => { name: 'NEW_FILE' })

# create request
req = "<request>
<action type='submit'>
<source project='home:tom:branches:BaseDistro2.0:LinkedUpdateProject' package='pack2' />
<target project='DummY' package='pack2.NEW' />
<options>
<sourceupdate>cleanup</sourceupdate>
<updatelink>true</updatelink>
</options>
</action>
<description>SUBMIT</description>
<state who='Iggy' name='new'/>
</request>"
post '/request?cmd=create', req
assert_response :success
assert_xml_tag(:tag => 'request')
node = Xmlhash.parse(@response.body)
id = node['id']
assert id.present?

# ensure that the diff shows the link change
post "/request/#{id}?cmd=diff&view=xml", nil
assert_response :success
assert_xml_tag(:parent => { tag: 'file', attributes: { state: 'added' } }, :tag => 'new', :attributes => { name: '_link' })

# accept the request
login_king
post "/request/#{id}?cmd=changestate&newstate=accepted&force=1"
assert_response :success

# the link got transfered
get '/source/DummY/pack2.NEW/_link'
assert_response :success
assert_xml_tag(:tag => 'link', :attributes => { project: 'BaseDistro2.0:LinkedUpdateProject', package: nil })

###
# create delete request two times
login_tom
req = "<request>
<action type='delete'>
<target project='DummY' package='pack2'/>
</action>
<action type='delete'>
<target project='DummY' package='pack2.NEW'/>
</action>
<description>DELETE REQUEST</description>
<state who='tom' name='new'/>
</request>"
Expand Down

0 comments on commit 46b82c7

Please sign in to comment.