diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-07 21:46:17 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-08-07 21:46:17 +0400 |
commit | a0755d2f051c5a9cd31721333adee22cb40b1008 (patch) | |
tree | 089b0bf2dc06b3bfc47b5bdbbb2ab136c659a271 /spec/models/project_wiki_spec.rb | |
parent | fe228b89d540ff61fd97e27b0ebe5915a737bb52 (diff) |
Fix tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/models/project_wiki_spec.rb')
-rw-r--r-- | spec/models/project_wiki_spec.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index 56ec83e3e7d..e4ee2fc5b13 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -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 |