diff options
author | JB Vasseur <jvasseur@gmail.com> | 2018-10-18 09:33:46 +0900 |
---|---|---|
committer | JB Vasseur <jvasseur@gmail.com> | 2018-10-18 09:33:46 +0900 |
commit | 84b69a95bbe110cb688b7b6b6f20a53ff3819c89 (patch) | |
tree | 7b56b299858ebdcfd4f206de94a67f67ef985876 /spec/finders | |
parent | 1ae9aefe5572cc62256f28e16163015f075b6c59 (diff) | |
download | gitlab-ce-84b69a95bbe110cb688b7b6b6f20a53ff3819c89.tar.gz |
Test ApplicationsFinder !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..a75eb9c9ca5 --- /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 |