gitlab-org--gitlab-foss/spec/finders/applications_finder_spec.rb

23 lines
757 B
Ruby
Raw Normal View History

2018-10-18 00:33:46 +00:00
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ApplicationsFinder do
2018-10-18 00:33:46 +00:00
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
2018-10-18 01:08:23 +00:00
expect(found).to match_array([application1, application2])
2018-10-18 00:33:46 +00:00
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