Commit 76e259d3 authored by Nejc Habjan's avatar Nejc Habjan

Add test for deploy token optional params

parent 92aac433
......@@ -234,6 +234,25 @@ describe API::DeployTokens do
expect(response).to match_response_schema('public_api/v4/deploy_token')
end
context 'with no optional params given' do
let(:params) do
{
name: 'Foo',
scopes: [
'read_repository'
]
}
end
it 'creates the deploy token with default values' do
subject
expect(response).to have_gitlab_http_status(:created)
expect(json_response['username']).to match(/gitlab\+deploy-token-\d+/)
expect(json_response['expires_at']).to eq(nil)
end
end
context 'with an invalid scope' do
before do
params[:scopes] = %w[read_repository all_access]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment