Commit a0755d2f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
parent fe228b89
...@@ -44,8 +44,8 @@ describe Projects::BlobController do ...@@ -44,8 +44,8 @@ describe Projects::BlobController do
end end
context 'redirect to tree' do context 'redirect to tree' do
let(:id) { 'master/doc' } let(:id) { 'markdown/doc' }
it { should redirect_to("/#{project.path_with_namespace}/tree/master/doc") } it { should redirect_to("/#{project.path_with_namespace}/tree/markdown/doc") }
end end
end end
end end
...@@ -26,7 +26,7 @@ describe Projects::TreeController do ...@@ -26,7 +26,7 @@ describe Projects::TreeController do
end end
context "valid branch, valid path" do context "valid branch, valid path" do
let(:id) { 'master/app/' } let(:id) { 'master/encoding/' }
it { should respond_with(:success) } it { should respond_with(:success) }
end end
...@@ -36,7 +36,7 @@ describe Projects::TreeController do ...@@ -36,7 +36,7 @@ describe Projects::TreeController do
end end
context "invalid branch, valid path" do context "invalid branch, valid path" do
let(:id) { 'invalid-branch/app/' } let(:id) { 'invalid-branch/encoding/' }
it { should respond_with(:not_found) } it { should respond_with(:not_found) }
end end
end end
......
...@@ -41,23 +41,13 @@ describe ProjectWiki do ...@@ -41,23 +41,13 @@ describe ProjectWiki do
subject.wiki.should be_a Gollum::Wiki subject.wiki.should be_a Gollum::Wiki
end end
before do
Gitlab::Shell.any_instance.stub(:add_repository) do
create_temp_repo("#{Rails.root}/tmp/test-git-base-path/non-existant.wiki.git")
end
project.stub(:path_with_namespace).and_return("non-existant")
end
it "creates a new wiki repo if one does not yet exist" do it "creates a new wiki repo if one does not yet exist" do
wiki = ProjectWiki.new(project, user) project_wiki.create_page("index", "test content").should be_true
wiki.create_page("index", "test content").should_not == false
FileUtils.rm_rf wiki.send(:path_to_repo)
end end
it "raises CouldNotCreateWikiError if it can't create the wiki repository" do it "raises CouldNotCreateWikiError if it can't create the wiki repository" do
ProjectWiki.any_instance.stub(:init_repo).and_return(false) project_wiki.stub(:init_repo).and_return(false)
expect { ProjectWiki.new(project, user).wiki }.to raise_exception(ProjectWiki::CouldNotCreateWikiError) expect { project_wiki.send(:create_repo!) }.to raise_exception(ProjectWiki::CouldNotCreateWikiError)
end end
end end
......
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