summaryrefslogtreecommitdiff
path: root/spec/services/notes
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2016-12-23 00:44:02 -0500
committerRuben Davila <rdavila84@gmail.com>2017-01-15 11:10:04 -0500
commit17196a2ff31c4eb65fa9ecff6f7208171e26059b (patch)
treee9a491799b764c42f3c0c20cb33fa763ebb520df /spec/services/notes
parent64dd41a0e21360c380cab394f8a5c9b4945b7fd1 (diff)
downloadgitlab-ce-17196a2ff31c4eb65fa9ecff6f7208171e26059b.tar.gz
Backport backend work for time tracking.
Diffstat (limited to 'spec/services/notes')
-rw-r--r--spec/services/notes/slash_commands_service_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/services/notes/slash_commands_service_spec.rb b/spec/services/notes/slash_commands_service_spec.rb
index 960b5cd5e6f..1a64c8bbf00 100644
--- a/spec/services/notes/slash_commands_service_spec.rb
+++ b/spec/services/notes/slash_commands_service_spec.rb
@@ -86,6 +86,18 @@ describe Notes::SlashCommandsService, services: true do
expect(note.noteable).to be_open
end
end
+
+ describe '/spend' do
+ let(:note_text) { '/spend 1h' }
+
+ it 'updates the spent time on the noteable' do
+ content, command_params = service.extract_commands(note)
+ service.execute(command_params, note)
+
+ expect(content).to eq ''
+ expect(note.noteable.time_spent).to eq(3600)
+ end
+ end
end
describe 'note with command & text' do