summaryrefslogtreecommitdiff
path: root/spec/presenters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 09:06:39 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 09:06:39 +0000
commitcd15d0e6c32da7f69689c7cff2e90aeda33b8318 (patch)
tree8343899f0873ab05f3eadca72c5f6e0a653a12ac /spec/presenters
parentdd6afb4b4785ed1889defc6d7bb8ef114dd4eb50 (diff)
downloadgitlab-ce-cd15d0e6c32da7f69689c7cff2e90aeda33b8318.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters')
-rw-r--r--spec/presenters/sentry_detailed_error_presenter_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/presenters/sentry_detailed_error_presenter_spec.rb b/spec/presenters/sentry_detailed_error_presenter_spec.rb
new file mode 100644
index 00000000000..e483b6d41a1
--- /dev/null
+++ b/spec/presenters/sentry_detailed_error_presenter_spec.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe SentryDetailedErrorPresenter do
+ let(:error) { build(:detailed_error_tracking_error) }
+ let(:presenter) { described_class.new(error) }
+
+ describe '#frequency' do
+ subject { presenter.frequency }
+
+ it 'returns an array of frequency structs' do
+ expect(subject).to include(a_kind_of(SentryDetailedErrorPresenter::FrequencyStruct))
+ end
+
+ it 'converts the times into UTC time objects' do
+ time = subject.first.time
+
+ expect(time).to be_a(Time)
+ expect(time.strftime('%z')).to eq '+0000'
+ end
+
+ it 'returns the correct counts' do
+ count = subject.first.count
+
+ expect(count).to eq error.frequency.first[1]
+ end
+ end
+end