summaryrefslogtreecommitdiff
path: root/spec/requests/api/projects_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-15 21:09:26 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-15 21:09:26 +0000
commit651917dbac09fc4fe9217c08d68420019dff59fb (patch)
tree6cdda4532d41b7862a33d7f3ab91959c3917d4f0 /spec/requests/api/projects_spec.rb
parentda1962d9ac710f95d350d2645c87f5a663123cf2 (diff)
downloadgitlab-ce-651917dbac09fc4fe9217c08d68420019dff59fb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/projects_spec.rb')
-rw-r--r--spec/requests/api/projects_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 80be5425b23..76b0c04e32d 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -2679,6 +2679,26 @@ RSpec.describe API::Projects do
end
end
end
+
+ context 'when updating service desk' do
+ subject { put(api("/projects/#{project.id}", user), params: { service_desk_enabled: true }) }
+
+ before do
+ project.update!(service_desk_enabled: false)
+
+ allow(::Gitlab::IncomingEmail).to receive(:enabled?).and_return(true)
+ end
+
+ it 'returns 200' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:ok)
+ end
+
+ it 'enables the service_desk' do
+ expect { subject }.to change { project.reload.service_desk_enabled }.to(true)
+ end
+ end
end
describe 'POST /projects/:id/archive' do