diff options
Diffstat (limited to 'spec/serializers/analytics_issue_entity_spec.rb')
-rw-r--r-- | spec/serializers/analytics_issue_entity_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/serializers/analytics_issue_entity_spec.rb b/spec/serializers/analytics_issue_entity_spec.rb index bc5cab638cd..ca1e0705d77 100644 --- a/spec/serializers/analytics_issue_entity_spec.rb +++ b/spec/serializers/analytics_issue_entity_spec.rb @@ -11,6 +11,7 @@ RSpec.describe AnalyticsIssueEntity do iid: "1", id: "1", created_at: "2016-11-12 15:04:02.948604", + end_event_timestamp: "2022-05-24 14:33:01.529701", author: user, project_path: project.path, namespace_path: project.namespace.route.path @@ -40,10 +41,34 @@ RSpec.describe AnalyticsIssueEntity do expect(subject).to include(:namespace_full_path) end + it 'contains the end event timestamp' do + expect(entity.as_json[:end_event_timestamp]).to match(/ ago$/) + end + it 'does not contain sensitive information' do expect(subject).not_to include(/token/) expect(subject).not_to include(/variables/) end + + context 'when end_event_timestamp is nil' do + let(:entity_hash) do + { + total_time: "172802.724419", + title: "Eos voluptatem inventore in sed.", + iid: "1", + id: "1", + created_at: "2016-11-12 15:04:02.948604", + end_event_timestamp: nil, + author: user, + project_path: project.path, + namespace_path: project.namespace.route.path + } + end + + it 'contains a nil end_event_timestamp' do + expect(entity.as_json[:end_event_timestamp]).to be_nil + end + end end context 'without subgroup' do |