diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-16 15:40:25 +0800 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-16 19:57:49 +0800 |
commit | e0b6838a90b47f34c1109b6a9727f249c6faebca (patch) | |
tree | 42eca4e94f51500019b54f3d04277b1ae1307428 /spec/requests/api/issues_spec.rb | |
parent | 7994db791ab758d81f7a446eb8e2338336e184fd (diff) | |
download | gitlab-ce-e0b6838a90b47f34c1109b6a9727f249c6faebca.tar.gz |
Set correct timestamps when creating past issues58361-issue-create-system-note-timestamp
Sets `system_note_timestamp` from `created_at`
Diffstat (limited to 'spec/requests/api/issues_spec.rb')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 86484ce62f8..0fa34688371 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -1480,12 +1480,20 @@ describe API::Issues do let(:params) { { title: 'new issue', labels: 'label, label2', created_at: creation_time } } context 'by an admin' do - it 'sets the creation time on the new issue' do + before do post api("/projects/#{project.id}/issues", admin), params: params + end + it 'sets the creation time on the new issue' do expect(response).to have_gitlab_http_status(201) expect(Time.parse(json_response['created_at'])).to be_like_time(creation_time) end + + it 'sets the system notes timestamp based on creation time' do + issue = Issue.find(json_response['id']) + + expect(issue.resource_label_events.last.created_at).to be_like_time(creation_time) + end end context 'by a project owner' do |