diff options
author | Rémy Coutable <remy@rymai.me> | 2019-06-17 10:21:35 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-06-17 10:21:35 +0000 |
commit | b37ca62686f10dd3c2107ce34c5e1ed800706c67 (patch) | |
tree | d3fd9f3c5c16f0094b646bce1ff5e3be451f97f3 /spec/models | |
parent | c6cf52915b076c1c12bfe3ae3628145bebd8f1a3 (diff) | |
parent | dcba5279b6e4bda905f5fa37a557b94f1fd42ba9 (diff) | |
download | gitlab-ce-b37ca62686f10dd3c2107ce34c5e1ed800706c67.tar.gz |
Merge branch 'sh-fix-issue-63158' into 'master'
Fix inability to set visibility_level on project via API
Closes #63158
See merge request gitlab-org/gitlab-ce!29578
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index aad08b9d4aa..673a1d7936f 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1479,11 +1479,28 @@ describe Project do end context 'when set to INTERNAL in application settings' do + using RSpec::Parameterized::TableSyntax + before do stub_application_setting(default_project_visibility: Gitlab::VisibilityLevel::INTERNAL) end it { is_expected.to eq(Gitlab::VisibilityLevel::INTERNAL) } + + where(:attribute_name, :value) do + :visibility | 'public' + :visibility_level | Gitlab::VisibilityLevel::PUBLIC + 'visibility' | 'public' + 'visibility_level' | Gitlab::VisibilityLevel::PUBLIC + end + + with_them do + it 'sets the visibility level' do + proj = described_class.new(attribute_name => value, name: 'test', path: 'test') + + expect(proj.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC) + end + end end end |