Skip to content

Commit

Permalink
[api] add a test case for the osc open incident request search
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Nov 9, 2012
1 parent 7f67a79 commit b18b801
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/api/test/functional/maintenance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ def test_mbranch_and_maintenance_per_package_request
assert node.has_attribute?(:id)
id1 = node.value(:id)

# search as used by osc sees it
get "/search/request", :match => 'action/@type="maintenance_incident" and (state/@name="new" or state/@name="review") and starts-with(action/target/@project, "My:Maintenance")'
assert_response :success
assert_xml_tag :parent => { :tag => "collection" }, :tag => "request", :attributes => { :id => id1 }

# accept request
prepare_request_with_user "maintenance_coord", "power"
post "/request/#{id1}?cmd=changestate&newstate=accepted"
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ def test_create_and_revoke_submit_request_permissions
assert_xml_tag( :tag => "review", :attributes => { :by_project => "home:Iggy", :by_package => "TestPack" } )

# test search via xpath as well
get "search/request", :match => "state/@name='review' and review[@by_project='home:Iggy' and @state='new']"
get "/search/request", :match => "state/@name='review' and review[@by_project='home:Iggy' and @state='new']"
assert_response :success
assert_xml_tag( :tag => 'collection', :child => {:tag => 'request' } )
assert_xml_tag( :tag => "review", :attributes => { :by_project => "home:Iggy", :by_package => "TestPack" } )
Expand Down

0 comments on commit b18b801

Please sign in to comment.