Skip to content

Commit

Permalink
fixing tests after refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Feb 11, 2013
1 parent 2a1fac9 commit ab0cfc0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion spec/lib/project_mover_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/shell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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)
Expand All @@ -13,5 +13,5 @@
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
7 changes: 1 addition & 6 deletions spec/models/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
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
Expand All @@ -91,7 +86,7 @@

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
Expand Down
4 changes: 2 additions & 2 deletions spec/observers/key_observer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

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
Expand Down
2 changes: 1 addition & 1 deletion spec/workers/post_receive_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
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

0 comments on commit ab0cfc0

Please sign in to comment.