summaryrefslogtreecommitdiff
path: root/spec/support/shared_contexts
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-08 00:08:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-08 00:08:54 +0000
commitbef1bd93d113723a156f5943e743193afad1ef71 (patch)
treea16b96ee621da6b525366c1b165dddb616cbc4e2 /spec/support/shared_contexts
parent0c6bc5443aa6c8f3e4becccb89fc0f135b4c64c8 (diff)
downloadgitlab-ce-bef1bd93d113723a156f5943e743193afad1ef71.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_contexts')
-rw-r--r--spec/support/shared_contexts/features/error_tracking_shared_context.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/support/shared_contexts/features/error_tracking_shared_context.rb b/spec/support/shared_contexts/features/error_tracking_shared_context.rb
index 3da6e2b13bb..47d131b1778 100644
--- a/spec/support/shared_contexts/features/error_tracking_shared_context.rb
+++ b/spec/support/shared_contexts/features/error_tracking_shared_context.rb
@@ -11,17 +11,25 @@ shared_context 'sentry error tracking context feature' do
let_it_be(:event_response) { JSON.parse(event_response_body) }
let(:sentry_api_urls) { Sentry::ApiUrls.new(project_error_tracking_settings.api_url) }
let(:issue_id) { issue_response['id'] }
+ let(:issue_seen) { 1.year.ago.utc }
+ let(:formatted_issue_seen) { issue_seen.strftime("%Y-%m-%d %I:%M:%S%p %Z") }
+ let(:date_received) { 1.month.ago.utc }
before do
request_headers = { 'Authorization' => 'Bearer access_token_123', 'Content-Type' => 'application/json' }
response_headers = { 'Content-Type' => 'application/json' }
+
+ issue_response['firstSeen'] = issue_seen.iso8601(6)
+ issue_response['lastSeen'] = issue_seen.iso8601(6)
+ event_response['dateReceived'] = date_received.iso8601(6)
+
issue_url = sentry_api_urls.issue_url(issue_id).to_s
stub_request(:get, issue_url)
.with(headers: request_headers)
- .to_return(status: 200, body: issue_response_body, headers: response_headers)
+ .to_return(status: 200, body: issue_response.to_json, headers: response_headers)
event_url = sentry_api_urls.issue_latest_event_url(issue_id).to_s
stub_request(:get, event_url)
.with(headers: request_headers)
- .to_return(status: 200, body: event_response_body, headers: response_headers)
+ .to_return(status: 200, body: event_response.to_json, headers: response_headers)
end
end