Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[api] support binary package upload for the admin
- Loading branch information
1 parent
6a1c1a1
commit 5281e4b
Showing
2 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,32 @@ def test_index | |
| assert_response 404 | ||
| end | ||
|
|
||
| def test_upload_binaries | ||
| ActionController::IntegrationTest::reset_auth | ||
| post "/build/home:Iggy/10.2/i586/TestPack", nil | ||
| assert_response 401 | ||
|
|
||
| prepare_request_with_user "adrian", "so_alone" | ||
| post "/build/home:Iggy/10.2/i586/TestPack", nil | ||
| assert_response 403 | ||
|
|
||
| prepare_request_with_user "king", "sunflower" | ||
| post "/build/home:Iggy/10.2/i586/TestPack", nil | ||
| assert_response 400 # actually a success, it reached the backend | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lnussel
via email
Member
|
||
| assert_tag :tag => "status", :attributes => { :code => "400", :origin => "backend" } | ||
|
|
||
| # check not supported methods | ||
| post "/build/home:Iggy/10.2/i586/_repository", nil | ||
| assert_response 404 | ||
| assert_tag :tag => "status", :attributes => { :code => "unknown_package" } | ||
| put "/build/home:Iggy/10.2/i586/TestPack", nil | ||
| assert_response 400 | ||
| assert_tag :tag => "status", :attributes => { :code => "invalid_http_method" } | ||
| delete "/build/home:Iggy/10.2/i586/TestPack" | ||
| assert_response 400 | ||
| assert_tag :tag => "status", :attributes => { :code => "invalid_http_method" } | ||
| end | ||
|
|
||
| def test_dispatchprios | ||
| ActionController::IntegrationTest::reset_auth | ||
| get "/build/_dispatchprios" | ||
|
|
||
Huh?