From ab0cfc00367a60cfe9cc488521bf55882d54769a Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Mon, 11 Feb 2013 20:28:27 +0200
Subject: [PATCH] fixing tests after refactoring

---
 spec/lib/project_mover_spec.rb      | 2 +-
 spec/lib/shell_spec.rb              | 4 ++--
 spec/models/project_spec.rb         | 7 +------
 spec/observers/key_observer_spec.rb | 4 ++--
 spec/workers/post_receive_spec.rb   | 2 +-
 5 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/spec/lib/project_mover_spec.rb b/spec/lib/project_mover_spec.rb
index 28323b24ef6..9202befdcb2 100644
--- a/spec/lib/project_mover_spec.rb
+++ b/spec/lib/project_mover_spec.rb
@@ -7,7 +7,7 @@ describe Gitlab::ProjectMover do
     FileUtils.rm_rf base_path if File.exists? base_path
     FileUtils.mkdir_p base_path
 
-    Gitlab.config.gitolite.stub(repos_path: base_path)
+    Gitlab.config.gitlab_shell.stub(repos_path: base_path)
 
     @project = create(:project)
   end
diff --git a/spec/lib/shell_spec.rb b/spec/lib/shell_spec.rb
index 1c546e59235..3c04f4bbeb6 100644
--- a/spec/lib/shell_spec.rb
+++ b/spec/lib/shell_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
 
 describe Gitlab::Shell do
   let(:project) { double('Project', id: 7, path: 'diaspora') }
-  let(:gitolite) { Gitlab::Shell.new }
+  let(:gitlab_shell) { Gitlab::Shell.new }
 
   before do
     Project.stub(find: project)
@@ -13,5 +13,5 @@ describe Gitlab::Shell do
   it { should respond_to :add_repository }
   it { should respond_to :remove_repository }
 
-  it { gitolite.url_to_repo('diaspora').should == Gitlab.config.gitolite.ssh_path_prefix + "diaspora.git" }
+  it { gitlab_shell.url_to_repo('diaspora').should == Gitlab.config.gitlab_shell.ssh_path_prefix + "diaspora.git" }
 end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 3dccb482375..4b620a2fa3e 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -66,11 +66,6 @@ describe Project do
       project.should_not be_valid
       project.errors[:base].first.should match(/Your own projects limit is 1/)
     end
-
-    it "should not allow 'gitolite-admin' as repo name" do
-      should allow_value("blah").for(:path)
-      should_not allow_value("gitolite-admin").for(:path)
-    end
   end
 
   describe "Respond to" do
@@ -91,7 +86,7 @@ describe Project do
 
   it "should return valid url to repo" do
     project = Project.new(path: "somewhere")
-    project.url_to_repo.should == Gitlab.config.gitolite.ssh_path_prefix + "somewhere.git"
+    project.url_to_repo.should == Gitlab.config.gitlab_shell.ssh_path_prefix + "somewhere.git"
   end
 
   it "returns the full web URL for this repo" do
diff --git a/spec/observers/key_observer_spec.rb b/spec/observers/key_observer_spec.rb
index 0a886a57afd..e1412f52e83 100644
--- a/spec/observers/key_observer_spec.rb
+++ b/spec/observers/key_observer_spec.rb
@@ -14,14 +14,14 @@ describe KeyObserver do
 
   context :after_save do
     it do
-      GitoliteWorker.should_receive(:perform_async).with(:add_key, @key.shell_id, @key.key)
+      GitlabShellWorker.should_receive(:perform_async).with(:add_key, @key.shell_id, @key.key)
       @observer.after_save(@key)
     end
   end
 
   context :after_destroy do
     it do
-      GitoliteWorker.should_receive(:perform_async).with(:remove_key, @key.shell_id, @key.key)
+      GitlabShellWorker.should_receive(:perform_async).with(:remove_key, @key.shell_id, @key.key)
       @observer.after_destroy(@key)
     end
   end
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb
index f1a69b1b2e4..d38cd59efa7 100644
--- a/spec/workers/post_receive_spec.rb
+++ b/spec/workers/post_receive_spec.rb
@@ -39,6 +39,6 @@ describe PostReceive do
   end
 
   def pwd(project)
-    File.join(Gitlab.config.gitolite.repos_path, project.path_with_namespace)
+    File.join(Gitlab.config.gitlab_shell.repos_path, project.path_with_namespace)
   end
 end
-- 
GitLab