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