diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-25 06:08:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-25 06:08:38 +0000 |
commit | e83b20c4f32415ecc6c76a33d6259bfca13ec250 (patch) | |
tree | ede0bd76eb88e66a486e5a4601fc93391e40a5af /spec/serializers | |
parent | d7f1d79eb586f756b120e7380393248009e62a00 (diff) | |
download | gitlab-ce-e83b20c4f32415ecc6c76a33d6259bfca13ec250.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-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 |