Skip to content

Commit

Permalink
[api] backend branch creates no package name in link file anymore whe…
Browse files Browse the repository at this point in the history
…n they are the same
  • Loading branch information
adrianschroeter committed Feb 21, 2012
1 parent 98b4570 commit 4a25ba5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions src/api/test/functional/maintenance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_branch_package
assert_response :success
ret = ActiveXML::XMLNode.new @response.body
assert_equal ret.project, "BaseDistro:Update"
assert_equal ret.package, "pack1"
assert_nil ret.package
assert_not_nil ret.baserev
assert_not_nil ret.patches
assert_not_nil ret.patches.branch
Expand All @@ -48,7 +48,7 @@ def test_branch_package
assert_response :success
ret = ActiveXML::XMLNode.new @response.body
assert_equal ret.project, "Devel:BaseDistro:Update"
assert_equal ret.package, "pack2"
assert_nil ret.package
assert_not_nil ret.baserev
assert_not_nil ret.patches
assert_not_nil ret.patches.branch
Expand All @@ -61,7 +61,7 @@ def test_branch_package
assert_response :success
ret = ActiveXML::XMLNode.new @response.body
assert_equal ret.project, "Devel:BaseDistro:Update"
assert_equal ret.package, "pack3"
assert_nil ret.package
assert_not_nil ret.baserev
assert_not_nil ret.patches
assert_not_nil ret.patches.branch
Expand All @@ -74,7 +74,7 @@ def test_branch_package
assert_response :success
ret = ActiveXML::XMLNode.new @response.body
assert_equal ret.project, "BaseDistro2.0:LinkedUpdateProject"
assert_equal ret.package, "pack2"
assert_nil ret.package

# check if we can upload a link to a packge only exist via project link
put "/source/home:tom:branches:BaseDistro2.0:LinkedUpdateProject/pack2/_link", @response.body
Expand Down Expand Up @@ -194,6 +194,11 @@ def test_maintenance_request_from_foreign_project
assert_tag :tag => 'packager', :content => "tom"
assert_tag :tag => 'description', :content => "To fix my bug"

# reopen ...
prepare_request_with_user "maintenance_coord", "power"
post "/request/#{id2}?cmd=changestate&newstate=new"
assert_response 403

# cleanup
prepare_request_with_user "king", "sunflower"
delete "/source/BaseDistro2.0:LinkedUpdateProject/kdelibs"
Expand Down
6 changes: 3 additions & 3 deletions src/api/test/functional/request_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_submit_request_of_new_package
assert_response :success
get "/source/home:Iggy:branches:home:Iggy/NEW_PACKAGE/_link"
assert_response :success
assert_tag( :tag => "link", :attributes => { :missingok => 'true', :project => 'home:Iggy', :package => 'NEW_PACKAGE' } )
assert_tag( :tag => "link", :attributes => { :missingok => 'true', :project => 'home:Iggy', :package => nil } )
put "/source/home:Iggy:branches:home:Iggy/NEW_PACKAGE/new_file", "my content"
assert_response :success

Expand Down Expand Up @@ -1347,7 +1347,7 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again
assert_response :success
ret = ActiveXML::XMLNode.new @response.body
assert_equal ret.project, "BaseDistro2.0:LinkedUpdateProject"
assert_equal ret.package, "pack2"
assert_nil ret.package # same package name

# create request
req = "<request>
Expand Down Expand Up @@ -1386,7 +1386,7 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again
# pack2 got created
get "/source/DummY/pack2/_link"
assert_response :success
assert_tag( :tag => "link", :attributes => { :project => 'BaseDistro2.0:LinkedUpdateProject', :package => "pack2" } )
assert_tag( :tag => "link", :attributes => { :project => 'BaseDistro2.0:LinkedUpdateProject', :package => nil } )

# create delete request two times
prepare_request_with_user "tom", "thunder"
Expand Down
2 changes: 1 addition & 1 deletion src/api/test/functional/source_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ def test_branch_package_delete_and_undelete
assert_response :success
ret = ActiveXML::XMLNode.new @response.body
assert_equal ret.project, "home:Iggy"
assert_equal ret.package, "TestPack"
assert_nil ret.package
assert_not_nil ret.baserev
assert_not_nil ret.patches
assert_not_nil ret.patches.branch
Expand Down

0 comments on commit 4a25ba5

Please sign in to comment.