Commit ac6b9faf authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
parent b007cadf
...@@ -47,30 +47,6 @@ describe UsersProjectObserver do ...@@ -47,30 +47,6 @@ describe UsersProjectObserver do
end end
describe "#after_create" do describe "#after_create" do
context 'wiki_enabled creates repository directory' do
context 'wiki_enabled true creates wiki repository directory' do
before do
@project = create(:project, wiki_enabled: true)
@path = GollumWiki.new(@project, user).send(:path_to_repo)
end
after do
FileUtils.rm_rf(@path)
end
it { File.exists?(@path).should be_true }
end
context 'wiki_enabled false does not create wiki repository directory' do
before do
@project = create(:project, wiki_enabled: false)
@path = GollumWiki.new(@project, user).send(:path_to_repo)
end
it { File.exists?(@path).should be_false }
end
end
it "should send email to user" do it "should send email to user" do
subject.should_receive(:notification) subject.should_receive(:notification)
Event.stub(create: true) Event.stub(create: true)
......
...@@ -38,6 +38,27 @@ describe Projects::CreateService do ...@@ -38,6 +38,27 @@ describe Projects::CreateService do
it { @project.namespace.should == @group } it { @project.namespace.should == @group }
end end
context 'wiki_enabled creates repository directory' do
context 'wiki_enabled true creates wiki repository directory' do
before do
@project = create_project(@user, @opts)
@path = GollumWiki.new(@project, @user).send(:path_to_repo)
end
it { File.exists?(@path).should be_true }
end
context 'wiki_enabled false does not create wiki repository directory' do
before do
@opts.merge!(wiki_enabled: false)
@project = create_project(@user, @opts)
@path = GollumWiki.new(@project, @user).send(:path_to_repo)
end
it { File.exists?(@path).should be_false }
end
end
context 'respect configured visibility setting' do context 'respect configured visibility setting' do
before(:each) do before(:each) do
@settings = double("settings") @settings = double("settings")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment