diff options
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/ci/runners_finder_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/finders/ci/runners_finder_spec.rb b/spec/finders/ci/runners_finder_spec.rb index 06cca035c6f..57a77b08cea 100644 --- a/spec/finders/ci/runners_finder_spec.rb +++ b/spec/finders/ci/runners_finder_spec.rb @@ -148,6 +148,14 @@ RSpec.describe Ci::RunnersFinder, feature_category: :runner_fleet do described_class.new(current_user: admin, params: { tag_name: %w[tag1 tag2] }).execute end end + + context 'by creator' do + it 'calls the corresponding scope on Ci::Runner' do + expect(Ci::Runner).to receive(:with_creator_id).with('1').and_call_original + + described_class.new(current_user: admin, params: { creator_id: '1' }).execute + end + end end context 'sorting' do @@ -608,6 +616,16 @@ RSpec.describe Ci::RunnersFinder, feature_category: :runner_fleet do expect(subject).to match_array([runner_project_active, runner_project_inactive]) end end + + context 'by creator' do + let_it_be(:runner_creator_1) { create(:ci_runner, creator_id: '1') } + + let(:extra_params) { { creator_id: '1' } } + + it 'returns correct runners' do + is_expected.to contain_exactly(runner_creator_1) + end + end end end |