diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-03-28 09:25:43 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-03-29 18:20:11 +0300 |
commit | a74a6cfddf1a6455e7ade0fd40e4053bb30f7f1e (patch) | |
tree | bad411906ad1267dabecf2447b9d139b6e4a9ab0 /spec/services/merge_requests/update_service_spec.rb | |
parent | 76a15db45f4911542241ae62fe871101f1f79a78 (diff) |
Create todos only for new mentions
Diffstat (limited to 'spec/services/merge_requests/update_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index ad3d767f193..f2ca1e6fcbd 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -12,6 +12,7 @@ describe MergeRequests::UpdateService, services: true do let(:merge_request) do create(:merge_request, :simple, title: 'Old title', + description: "FYI #{user2.to_reference}", assignee_id: user3.id, source_project: project) end @@ -225,16 +226,24 @@ describe MergeRequests::UpdateService, services: true do it 'marks pending todos as done' do expect(pending_todo.reload).to be_done end + + it 'does not create any new todos' do + expect(Todo.count).to eq(1) + end end context 'when the description change' do before do - update_merge_request({ description: 'Also please fix' }) + update_merge_request({ description: "Also please fix #{user2.to_reference} #{user3.to_reference}" }) end it 'marks pending todos as done' do expect(pending_todo.reload).to be_done end + + it 'creates only 1 new todo' do + expect(Todo.count).to eq(2) + end end context 'when is reassigned' do |