2012-09-07 01:16:29 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Gitlab::Gitolite do
|
2013-01-28 10:53:01 -05:00
|
|
|
let(:project) { double('Project', id: 7, path: 'diaspora') }
|
2012-09-07 01:16:29 -04:00
|
|
|
let(:gitolite_config) { double('Gitlab::GitoliteConfig') }
|
|
|
|
let(:gitolite) { Gitlab::Gitolite.new }
|
|
|
|
|
|
|
|
before do
|
|
|
|
gitolite.stub(config: gitolite_config)
|
2013-01-28 10:53:01 -05:00
|
|
|
Project.stub(find: project)
|
2012-09-07 01:16:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it { should respond_to :set_key }
|
|
|
|
it { should respond_to :remove_key }
|
|
|
|
|
|
|
|
it { should respond_to :update_repository }
|
|
|
|
it { should respond_to :create_repository }
|
|
|
|
it { should respond_to :remove_repository }
|
|
|
|
|
2012-12-14 19:16:25 -05:00
|
|
|
it { gitolite.url_to_repo('diaspora').should == Gitlab.config.gitolite.ssh_path_prefix + "diaspora.git" }
|
2012-09-07 01:16:29 -04:00
|
|
|
|
|
|
|
it "should call config update" do
|
|
|
|
gitolite_config.should_receive(:update_project!)
|
2013-01-28 10:39:02 -05:00
|
|
|
gitolite.update_repository(project.id)
|
2012-09-07 01:16:29 -04:00
|
|
|
end
|
|
|
|
end
|