Small improvement.
This commit is contained in:
parent
4655039cd1
commit
a6df782fef
2 changed files with 22 additions and 0 deletions
|
@ -50,6 +50,17 @@ class PackagesControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
end
|
||||
|
||||
test 'packages index with nobody' do
|
||||
|
||||
# index
|
||||
get '/api/v1/packages'
|
||||
assert_response(401)
|
||||
result = JSON.parse(@response.body)
|
||||
assert_equal(result.class, Hash)
|
||||
assert_not(result['packages'])
|
||||
|
||||
end
|
||||
|
||||
test 'packages index with admin' do
|
||||
|
||||
credentials = ActionController::HttpAuthentication::Basic.encode_credentials('packages-admin@example.com', 'adminpw')
|
||||
|
|
|
@ -50,6 +50,17 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
end
|
||||
|
||||
test 'settings index with nobody' do
|
||||
|
||||
# index
|
||||
get '/api/v1/settings'
|
||||
assert_response(401)
|
||||
result = JSON.parse(@response.body)
|
||||
assert_equal(result.class, Hash)
|
||||
assert_not(result['settings'])
|
||||
|
||||
end
|
||||
|
||||
test 'settings index with admin' do
|
||||
|
||||
credentials = ActionController::HttpAuthentication::Basic.encode_credentials('packages-admin@example.com', 'adminpw')
|
||||
|
|
Loading…
Reference in a new issue