diff options
Diffstat (limited to 'spec/services/notes')
-rw-r--r-- | spec/services/notes/create_service_spec.rb | 4 | ||||
-rw-r--r-- | spec/services/notes/quick_actions_service_spec.rb | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb index 31263feb947..5b4d6188b66 100644 --- a/spec/services/notes/create_service_spec.rb +++ b/spec/services/notes/create_service_spec.rb @@ -307,7 +307,7 @@ RSpec.describe Notes::CreateService do ), # Set WIP status QuickAction.new( - action_text: "/wip", + action_text: "/draft", before_action: -> { issuable.reload.update!(title: "title") }, @@ -317,7 +317,7 @@ RSpec.describe Notes::CreateService do ), # Remove WIP status QuickAction.new( - action_text: "/wip", + action_text: "/draft", before_action: -> { issuable.reload.update!(title: "WIP: title") }, diff --git a/spec/services/notes/quick_actions_service_spec.rb b/spec/services/notes/quick_actions_service_spec.rb index 9692bb08379..cb7d0163cac 100644 --- a/spec/services/notes/quick_actions_service_spec.rb +++ b/spec/services/notes/quick_actions_service_spec.rb @@ -130,6 +130,17 @@ RSpec.describe Notes::QuickActionsService do end end + describe '/estimate' do + let(:note_text) { '/estimate 1h' } + + it 'adds time estimate to noteable' do + content = execute(note) + + expect(content).to be_empty + expect(note.noteable.time_estimate).to eq(3600) + end + end + describe 'note with command & text' do describe '/close, /label, /assign & /milestone' do let(:note_text) do @@ -302,6 +313,11 @@ RSpec.describe Notes::QuickActionsService do end it_behaves_like 'note on noteable that supports quick actions' do + let_it_be(:incident, reload: true) { create(:incident, project: project) } + let(:note) { build(:note_on_issue, project: project, noteable: incident) } + end + + it_behaves_like 'note on noteable that supports quick actions' do let(:merge_request) { create(:merge_request, source_project: project) } let(:note) { build(:note_on_merge_request, project: project, noteable: merge_request) } end |