summaryrefslogtreecommitdiff
path: root/spec/services/system_note_service_spec.rb
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-06-11 18:40:01 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-06-25 09:31:23 +0800
commit275a17589c2d468d8671a9f754a50b212273d509 (patch)
treefb491229331aa09e74fd14385b0682e693774395 /spec/services/system_note_service_spec.rb
parent4e283ee706b11fd3b918230976addc9a70603ce6 (diff)
downloadgitlab-ce-275a17589c2d468d8671a9f754a50b212273d509.tar.gz
Rename to time_tracking_limit_to_hours30355-use-hours-only-for-time-tracking
Changes migration and all other places the attribute is used
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r--spec/services/system_note_service_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb
index 2420817e1f7..30a867fa7ba 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -946,6 +946,18 @@ describe SystemNoteService do
expect(subject.note).to eq "changed time estimate to 1w 4d 5h"
end
+
+ context 'when time_tracking_limit_to_hours setting is true' do
+ before do
+ stub_application_setting(time_tracking_limit_to_hours: true)
+ end
+
+ it 'sets the note text' do
+ noteable.update_attribute(:time_estimate, 277200)
+
+ expect(subject.note).to eq "changed time estimate to 77h"
+ end
+ end
end
context 'without a time estimate' do
@@ -1022,6 +1034,18 @@ describe SystemNoteService do
end
end
+ context 'when time_tracking_limit_to_hours setting is true' do
+ before do
+ stub_application_setting(time_tracking_limit_to_hours: true)
+ end
+
+ it 'sets the note text' do
+ spend_time!(277200)
+
+ expect(subject.note).to eq "added 77h of time spent"
+ end
+ end
+
def spend_time!(seconds)
noteable.spend_time(duration: seconds, user_id: author.id)
noteable.save!