summaryrefslogtreecommitdiff
path: root/spec/models/error_tracking
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-30 12:09:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-30 12:09:48 +0000
commit96ee4961ce1984902f738ab651b99d2a1f01a65c (patch)
tree4add0def83c37189b44a15b203357303bba20582 /spec/models/error_tracking
parent4ac9f1b8eaef29daa484b27a3113505cfa6a6dcb (diff)
downloadgitlab-ce-96ee4961ce1984902f738ab651b99d2a1f01a65c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/error_tracking')
-rw-r--r--spec/models/error_tracking/error_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/error_tracking/error_spec.rb b/spec/models/error_tracking/error_spec.rb
index 57899985daf..739ef1c10d4 100644
--- a/spec/models/error_tracking/error_spec.rb
+++ b/spec/models/error_tracking/error_spec.rb
@@ -16,6 +16,24 @@ RSpec.describe ErrorTracking::Error, type: :model do
it { is_expected.to validate_presence_of(:actor) }
end
+ describe '.report_error' do
+ it 'updates existing record with a new timestamp' do
+ timestamp = Time.zone.now
+
+ reported_error = described_class.report_error(
+ name: error.name,
+ description: 'Lorem ipsum',
+ actor: error.actor,
+ platform: error.platform,
+ timestamp: timestamp
+ )
+
+ expect(reported_error.id).to eq(error.id)
+ expect(reported_error.last_seen_at).to eq(timestamp)
+ expect(reported_error.description).to eq('Lorem ipsum')
+ end
+ end
+
describe '#title' do
it { expect(error.title).to eq('ActionView::MissingTemplate Missing template posts/edit') }
end