diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-11 18:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-11 18:08:36 +0300 |
commit | 018431c70e62358b959d23e7881bf1513e68f165 (patch) | |
tree | 052ba4863efbcab40f41e8d4a09f5add9103c62b /spec/services/alert_management | |
parent | 0526dc1e681db465189573d0931610c049206106 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/alert_management')
-rw-r--r-- | spec/services/alert_management/alerts/update_service_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/services/alert_management/alerts/update_service_spec.rb b/spec/services/alert_management/alerts/update_service_spec.rb index 055b2f6585a..a3262f2e9de 100644 --- a/spec/services/alert_management/alerts/update_service_spec.rb +++ b/spec/services/alert_management/alerts/update_service_spec.rb @@ -45,7 +45,7 @@ describe AlertManagement::Alerts::UpdateService do end end - context 'when a model attribute is included' do + context 'when a model attribute is included without assignees' do let(:params) { { title: 'This is an updated alert.' } } it 'updates the attribute' do @@ -54,6 +54,10 @@ describe AlertManagement::Alerts::UpdateService do expect { response }.to change { alert.title }.from(original_title).to(params[:title]) expect(response).to be_success end + + it 'skips adding a todo' do + expect { response }.not_to change(Todo, :count) + end end context 'when assignees are included' do @@ -76,6 +80,10 @@ describe AlertManagement::Alerts::UpdateService do expect(response).to be_success end end + + it 'adds a todo' do + expect { response }.to change { Todo.where(user: user_with_permissions).count }.by(1) + end end end end |