diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 21:12:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-01 21:12:08 +0000 |
commit | d170c7eeef81debb74afa518c256358ccb7e231c (patch) | |
tree | dc4adba24cead9505703600189bbba712f442661 /spec/scripts/api | |
parent | 3bfb19d99e3508b2a42c49d09e5a3236d2ce3a29 (diff) | |
download | gitlab-ce-d170c7eeef81debb74afa518c256358ccb7e231c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/scripts/api')
-rw-r--r-- | spec/scripts/api/commit_merge_requests_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/scripts/api/commit_merge_requests_spec.rb b/spec/scripts/api/commit_merge_requests_spec.rb new file mode 100644 index 00000000000..461e3e2e068 --- /dev/null +++ b/spec/scripts/api/commit_merge_requests_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'fast_spec_helper' +require_relative '../../../scripts/api/commit_merge_requests' + +RSpec.describe CommitMergeRequests, feature_category: :tooling do + describe '#execute' do + let(:options) do + { + sha: 'asdf1234', + api_token: 'token', + project: 12345, + endpoint: 'https://example.gitlab.com' + } + end + + subject { described_class.new(options).execute } + + it 'requests commit_merge_requests from the gitlab client' do + expected_result = ['results'] + client = double('Gitlab::Client', commit_merge_requests: expected_result) # rubocop:disable RSpec/VerifiedDoubles + + expect(Gitlab).to receive(:client) + .with(endpoint: options[:endpoint], private_token: options[:api_token]) + .and_return(client) + + expect(subject).to eq(expected_result) + end + end +end |