mirror of
https://github.com/redmine/redmine.git
synced 2025-11-02 11:25:55 +01:00
Adds on optional API key to repositories management controller and reposman.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3201 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -68,4 +68,25 @@ class SysControllerTest < ActionController::TestCase
|
||||
get :fetch_changesets, :id => 'unknown'
|
||||
assert_response 404
|
||||
end
|
||||
|
||||
def test_disabled_ws_should_respond_with_403_error
|
||||
with_settings :sys_api_enabled => '0' do
|
||||
get :projects
|
||||
assert_response 403
|
||||
end
|
||||
end
|
||||
|
||||
def test_api_key
|
||||
with_settings :sys_api_key => 'my_secret_key' do
|
||||
get :projects, :key => 'my_secret_key'
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
|
||||
def test_wrong_key_should_respond_with_403_error
|
||||
with_settings :sys_api_enabled => 'my_secret_key' do
|
||||
get :projects, :key => 'wrong_key'
|
||||
assert_response 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user