From 17196a2ff31c4eb65fa9ecff6f7208171e26059b Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Fri, 23 Dec 2016 00:44:02 -0500 Subject: Backport backend work for time tracking. --- spec/services/notes/slash_commands_service_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/services/notes') 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 -- cgit v1.2.1