diff options
author | Rémy Coutable <remy@rymai.me> | 2018-10-22 11:52:42 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-10-22 11:52:42 +0300 |
commit | 631f4e2f54290b539fa3a7bc928589b1949adc34 (patch) | |
tree | b9da9af0823ab3a8ab618a61a60b1ee63f2af612 /spec/finders | |
parent | 5b6007f995b60b938c65efe9a18ed4f2c7dafa4d (diff) | |
parent | 192ccaebfc09c29bc62defb5f9a0fc69600600a1 (diff) |
Merge branch '52559-applications-api-get-delete' into 'master'
Add Applications API endpoints for listing and deleting entries.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52559
See merge request https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22296
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/applications_finder_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/finders/applications_finder_spec.rb b/spec/finders/applications_finder_spec.rb new file mode 100644 index 00000000000..14d6b35cc27 --- /dev/null +++ b/spec/finders/applications_finder_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ApplicationsFinder do + let(:application1) { create(:application, name: 'some_application', owner: nil, redirect_uri: 'http://some_application.url', scopes: '') } + let(:application2) { create(:application, name: 'another_application', owner: nil, redirect_uri: 'http://other_application.url', scopes: '') } + + describe '#execute' do + it 'returns an array of applications' do + found = described_class.new.execute + + expect(found).to match_array([application1, application2]) + end + it 'returns the application by id' do + params = { id: application1.id } + found = described_class.new(params).execute + + expect(found).to match(application1) + end + end +end |