diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2018-05-08 17:00:51 +0200 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2018-05-09 18:08:37 +0200 |
commit | 890dc39ee0c92adb10a3221c2a564533e038a72c (patch) | |
tree | c4f2e00d6c6786f0369597e6a586dd6f295edc37 /spec/models/concerns/issuable_spec.rb | |
parent | 533593e95cd3a922a2ec2ea43b345862361dfd67 (diff) | |
download | gitlab-ce-890dc39ee0c92adb10a3221c2a564533e038a72c.tar.gz |
Updates updated_at on issue when using /spend quick action
Diffstat (limited to 'spec/models/concerns/issuable_spec.rb')
-rw-r--r-- | spec/models/concerns/issuable_spec.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 05693f067e1..3d3092b8ac9 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -495,6 +495,14 @@ describe Issuable do expect(issue.total_time_spent).to eq(1800) end + + it 'updates issues updated_at' do + issue + + Timecop.travel(1.minute.from_now) do + expect { spend_time(1800) }.to change { issue.updated_at } + end + end end context 'substracting time' do @@ -510,9 +518,13 @@ describe Issuable do context 'when time to substract exceeds the total time spent' do it 'raise a validation error' do - expect do - spend_time(-3600) - end.to raise_error(ActiveRecord::RecordInvalid) + Timecop.travel(1.minute.from_now) do + expect do + expect do + spend_time(-3600) + end.to raise_error(ActiveRecord::RecordInvalid) + end.not_to change { issue.updated_at } + end end end end |