diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-16 10:40:25 +0300 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-16 14:57:49 +0300 |
commit | e0b6838a90b47f34c1109b6a9727f249c6faebca (patch) | |
tree | 42eca4e94f51500019b54f3d04277b1ae1307428 /spec/requests | |
parent | 7994db791ab758d81f7a446eb8e2338336e184fd (diff) |
Set correct timestamps when creating past issues
Sets `system_note_timestamp` from `created_at`
Diffstat (limited to 'spec/requests')
-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 |