diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/services/error_tracking/issue_latest_event_service_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/services/error_tracking/issue_latest_event_service_spec.rb')
-rw-r--r-- | spec/services/error_tracking/issue_latest_event_service_spec.rb | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/spec/services/error_tracking/issue_latest_event_service_spec.rb b/spec/services/error_tracking/issue_latest_event_service_spec.rb index b7560762ae4..e914cb1241e 100644 --- a/spec/services/error_tracking/issue_latest_event_service_spec.rb +++ b/spec/services/error_tracking/issue_latest_event_service_spec.rb @@ -5,12 +5,14 @@ require 'spec_helper' RSpec.describe ErrorTracking::IssueLatestEventService do include_context 'sentry error tracking context' - subject { described_class.new(project, user) } + let(:params) { {} } + + subject { described_class.new(project, user, params) } describe '#execute' do context 'with authorized user' do context 'when issue_latest_event returns an error event' do - let(:error_event) { build(:error_tracking_error_event) } + let(:error_event) { build(:error_tracking_sentry_error_event) } before do expect(error_tracking_setting) @@ -25,6 +27,22 @@ RSpec.describe ErrorTracking::IssueLatestEventService do include_examples 'error tracking service data not ready', :issue_latest_event include_examples 'error tracking service sentry error handling', :issue_latest_event include_examples 'error tracking service http status handling', :issue_latest_event + + context 'integrated error tracking' do + let_it_be(:error) { create(:error_tracking_error, project: project) } + let_it_be(:event) { create(:error_tracking_error_event, error: error) } + + let(:params) { { issue_id: error.id } } + + before do + error_tracking_setting.update!(integrated: true) + end + + it 'returns the latest event in expected format' do + expect(result[:status]).to eq(:success) + expect(result[:latest_event].to_json).to eq(event.to_sentry_error_event.to_json) + end + end end include_examples 'error tracking service unauthorized user' |