Skip to content
Snippets Groups Projects
Commit e7e1d76a authored by Angus MacArthur's avatar Angus MacArthur Committed by Wes Gurney
Browse files

make public/private setting for project creation configurable

parent d48805ba
No related branches found
No related tags found
1 merge request!4954Add support to configure webhook_timeout in gitlab.yaml
Loading
Loading
@@ -16,7 +16,8 @@ module Projects
wiki_enabled: default_features.wiki,
wall_enabled: default_features.wall,
snippets_enabled: default_features.snippets,
merge_requests_enabled: default_features.merge_requests
merge_requests_enabled: default_features.merge_requests,
public: default_features.public
}
 
@project = Project.new(default_opts.merge(params))
Loading
Loading
Loading
Loading
@@ -58,7 +58,8 @@ production: &base
wiki: true
wall: false
snippets: false
public: false
## Webhook settings
# Number of seconds to wait for HTTP response after sending webhook HTTP POST request (default: 10)
# webhook_timeout: 10
Loading
Loading
Loading
Loading
@@ -76,6 +76,7 @@ Settings.gitlab.default_projects_features['merge_requests'] = true if Settings.g
Settings.gitlab.default_projects_features['wiki'] = true if Settings.gitlab.default_projects_features['wiki'].nil?
Settings.gitlab.default_projects_features['wall'] = false if Settings.gitlab.default_projects_features['wall'].nil?
Settings.gitlab.default_projects_features['snippets'] = false if Settings.gitlab.default_projects_features['snippets'].nil?
Settings.gitlab.default_projects_features['public'] = false if Settings.gitlab.default_projects_features['public'].nil?
 
#
# Gravatar
Loading
Loading
Loading
Loading
@@ -30,6 +30,34 @@ describe Projects::CreateContext do
it { @project.owner.should == @user }
it { @project.namespace.should == @group }
end
context 'respect configured public setting' do
before(:each) do
@settings = double("settings")
@settings.stub(:issues) { true }
@settings.stub(:merge_requests) { true }
@settings.stub(:wiki) { true }
@settings.stub(:wall) { true }
@settings.stub(:snippets) { true }
stub_const("Settings", Class.new)
Settings.stub_chain(:gitlab, :default_projects_features).and_return(@settings)
end
context 'should be public when setting is public' do
before do
@settings.stub(:public) { true }
@project = create_project(@user, @opts)
end
it { @project.public.should be_true }
end
context 'should be private when setting is not public' do
before do
@settings.stub(:public) { false }
@project = create_project(@user, @opts)
end
it { @project.public.should be_false }
end
end
end
 
def create_project(user, opts)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment