Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 21:08:47 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-22 21:08:47 +0300
commit3832718d895bf8268f3e3aac85948e2792769345 (patch)
tree4a322399af568b6203e732ae2e2f3efc39b23a67 /spec/requests/api/applications_spec.rb
parent180cd023a11c0eb413ad0de124d9758ea25672bd (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/applications_spec.rb')
-rw-r--r--spec/requests/api/applications_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/applications_spec.rb b/spec/requests/api/applications_spec.rb
index 438d5dbf018..d110751e661 100644
--- a/spec/requests/api/applications_spec.rb
+++ b/spec/requests/api/applications_spec.rb
@@ -21,6 +21,7 @@ describe API::Applications, :api do
expect(json_response['application_id']).to eq application.uid
expect(json_response['secret']).to eq application.secret
expect(json_response['callback_url']).to eq application.redirect_uri
+ expect(json_response['confidential']).to eq application.confidential
end
it 'does not allow creating an application with the wrong redirect_uri format' do
@@ -72,6 +73,16 @@ describe API::Applications, :api do
expect(json_response).to be_a Hash
expect(json_response['error']).to eq('scopes is missing')
end
+
+ it 'does not allow creating an application with confidential set to nil' do
+ expect do
+ post api('/applications', admin_user), params: { name: 'application_name', redirect_uri: 'http://application.url', scopes: '', confidential: nil }
+ end.not_to change { Doorkeeper::Application.count }
+
+ expect(response).to have_gitlab_http_status(400)
+ expect(json_response).to be_a Hash
+ expect(json_response['message']['confidential'].first).to eq('is not included in the list')
+ end
end
context 'authorized user without authorization' do