diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-08 07:03:53 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-03-08 07:03:53 -0800 |
commit | 9c8e9046c7a10ff761a09697610eb52fd6578b88 (patch) | |
tree | 3d79020154ebcddec66e96292d561c1533c17f4e /spec | |
parent | cb1538bba7afac965f6ba2b09e8b94afdcdd7fbc (diff) | |
download | gitlab-ce-9c8e9046c7a10ff761a09697610eb52fd6578b88.tar.gz |
Fix Error 500 when updating a projectsh-fix-update-service
If no parameters were specified for project features but Wikis were disabled,
we would get "NoMethodError: undefined method `[]' for nil:NilClass".
Closes #44019
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/projects/update_service_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb index ad5a289290c..d454ac0bda5 100644 --- a/spec/services/projects/update_service_spec.rb +++ b/spec/services/projects/update_service_spec.rb @@ -132,6 +132,15 @@ describe Projects::UpdateService do expect(result).to eq({ status: :success }) expect(project.wiki_repository_exists?).to be false end + + it 'handles empty project feature attributes' do + project.project_feature.update(wiki_access_level: ProjectFeature::DISABLED) + + result = update_project(project, user, { name: 'test1' }) + + expect(result).to eq({ status: :success }) + expect(project.wiki_repository_exists?).to be false + end end context 'when enabling a wiki' do |