summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-31 21:08:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-31 21:08:52 +0000
commitd5d3c03598df712550acf0c6463a61c6e7dcc19e (patch)
treed0fdf0f9cd6df46aea6ed16b6556f44055efb642 /spec/support
parent0434f38ef1dce4fe640fe1e4542235746ceb943c (diff)
downloadgitlab-ce-d5d3c03598df712550acf0c6463a61c6e7dcc19e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared_examples/error_tracking_shared_examples.rb33
1 files changed, 28 insertions, 5 deletions
diff --git a/spec/support/shared_examples/error_tracking_shared_examples.rb b/spec/support/shared_examples/error_tracking_shared_examples.rb
index 86134fa7fd1..8e7a63b69c7 100644
--- a/spec/support/shared_examples/error_tracking_shared_examples.rb
+++ b/spec/support/shared_examples/error_tracking_shared_examples.rb
@@ -3,11 +3,34 @@
RSpec.shared_examples 'setting sentry error data' do
it 'sets the sentry error data correctly' do
aggregate_failures 'testing the sentry error is correct' do
- expect(error['id']).to eql sentry_error.to_global_id.to_s
- expect(error['sentryId']).to eql sentry_error.id.to_s
- expect(error['status']).to eql sentry_error.status.upcase
- expect(error['firstSeen']).to eql sentry_error.first_seen
- expect(error['lastSeen']).to eql sentry_error.last_seen
+ expect(error['id']).to eq sentry_error.to_global_id.to_s
+ expect(error['sentryId']).to eq sentry_error.id.to_s
+ expect(error['status']).to eq sentry_error.status.upcase
+ expect(error['firstSeen']).to eq sentry_error.first_seen
+ expect(error['lastSeen']).to eq sentry_error.last_seen
+ end
+ end
+end
+
+RSpec.shared_examples 'setting stack trace error' do
+ it 'sets the stack trace data correctly' do
+ aggregate_failures 'testing the stack trace is correct' do
+ expect(stack_trace_data['dateReceived']).to eq(sentry_stack_trace.date_received)
+ expect(stack_trace_data['issueId']).to eq(sentry_stack_trace.issue_id)
+ expect(stack_trace_data['stackTraceEntries']).to be_an_instance_of(Array)
+ expect(stack_trace_data['stackTraceEntries'].size).to eq(sentry_stack_trace.stack_trace_entries.size)
+ end
+ end
+
+ it 'sets the stack trace entry data correctly' do
+ aggregate_failures 'testing the stack trace entry is correct' do
+ stack_trace_entry = stack_trace_data['stackTraceEntries'].first
+ model_entry = sentry_stack_trace.stack_trace_entries.first
+
+ expect(stack_trace_entry['function']).to eq model_entry['function']
+ expect(stack_trace_entry['col']).to eq model_entry['colNo']
+ expect(stack_trace_entry['line']).to eq model_entry['lineNo'].to_s
+ expect(stack_trace_entry['fileName']).to eq model_entry['filename']
end
end
end