diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-08 18:08:00 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-08 18:08:00 +0300 |
commit | 684838d4bea13af1dac9c2f32b99985bf0f9f8e2 (patch) | |
tree | 611fcc177ba5a4fe702668c25aa68119675dbd8e /spec/models | |
parent | 012f9a4b9ec4a78d9593d882b38f95e376c2cfe2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/runner_spec.rb | 9 | ||||
-rw-r--r-- | spec/models/error_tracking/project_error_tracking_setting_spec.rb | 24 |
2 files changed, 31 insertions, 2 deletions
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index a3d1dcc79ee..344ca97c80f 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -2030,4 +2030,13 @@ RSpec.describe Ci::Runner, type: :model, feature_category: :runner do end end end + + describe '.with_creator' do + subject { described_class.with_creator } + + let!(:user) { create(:admin) } + let!(:runner) { create(:ci_runner, creator: user) } + + it { is_expected.to contain_exactly(runner) } + end end diff --git a/spec/models/error_tracking/project_error_tracking_setting_spec.rb b/spec/models/error_tracking/project_error_tracking_setting_spec.rb index bb32cae6b1f..d612c8f6e8b 100644 --- a/spec/models/error_tracking/project_error_tracking_setting_spec.rb +++ b/spec/models/error_tracking/project_error_tracking_setting_spec.rb @@ -341,12 +341,13 @@ RSpec.describe ErrorTracking::ProjectErrorTrackingSetting, feature_category: :er describe '#update_issue' do let(:result) { subject.update_issue(**opts) } - let(:opts) { { issue_id: 1, params: {} } } + let(:issue_id) { 1 } + let(:opts) { { issue_id: issue_id, params: {} } } before do allow(subject).to receive(:sentry_client).and_return(sentry_client) allow(sentry_client).to receive(:issue_details) - .with({ issue_id: 1 }) + .with({ issue_id: issue_id }) .and_return(Gitlab::ErrorTracking::DetailedError.new(project_id: sentry_project_id)) end @@ -419,6 +420,25 @@ RSpec.describe ErrorTracking::ProjectErrorTrackingSetting, feature_category: :er end end end + + describe 'passing parameters to sentry client' do + include SentryClientHelpers + + let(:sentry_url) { 'https://sentrytest.gitlab.com/api/0' } + let(:sentry_request_url) { "#{sentry_url}/issues/#{issue_id}/" } + let(:token) { 'test-token' } + let(:sentry_client) { ErrorTracking::SentryClient.new(sentry_url, token) } + + before do + stub_sentry_request(sentry_request_url, :put, body: true) + + allow(sentry_client).to receive(:update_issue).and_call_original + end + + it 'returns the successful response' do + expect(result).to eq(updated: true) + end + end end describe 'slugs' do |