diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-08 18:33:30 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-04-08 18:33:30 +0300 |
commit | 4317a2a3a2e39e4c2594b0b28abf7a8cc694eeab (patch) | |
tree | b8077805258a7652e08ecce36a5532d40bf03a9c /spec/services/note_summary_spec.rb | |
parent | 425377f35747131bed6550170af576d3028b28f9 (diff) |
Fix `updated_at` doesn't apply to `state_event` updates of issues via API
Diffstat (limited to 'spec/services/note_summary_spec.rb')
-rw-r--r-- | spec/services/note_summary_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/services/note_summary_spec.rb b/spec/services/note_summary_spec.rb index a6cc2251e48..f6ee15f750c 100644 --- a/spec/services/note_summary_spec.rb +++ b/spec/services/note_summary_spec.rb @@ -21,16 +21,20 @@ describe NoteSummary do describe '#note' do it 'returns note hash' do - expect(create_note_summary.note).to eq(noteable: noteable, project: project, author: user, note: 'note') + Timecop.freeze do + expect(create_note_summary.note).to eq(noteable: noteable, project: project, author: user, note: 'note', + created_at: Time.now) + end end context 'when noteable is a commit' do - let(:noteable) { build(:commit) } + let(:noteable) { build(:commit, system_note_timestamp: Time.at(43)) } it 'returns note hash specific to commit' do expect(create_note_summary.note).to eq( noteable: nil, project: project, author: user, note: 'note', - noteable_type: 'Commit', commit_id: noteable.id + noteable_type: 'Commit', commit_id: noteable.id, + created_at: Time.at(43) ) end end |