Remove outdated specs and fixed key remove
This commit is contained in:
parent
12198bee2f
commit
081c272b85
4 changed files with 4 additions and 27 deletions
|
@ -12,6 +12,7 @@ class KeyObserver < ActiveRecord::Observer
|
|||
def after_destroy(key)
|
||||
GitoliteWorker.perform_async(
|
||||
:remove_key,
|
||||
key.owner_name,
|
||||
key.key,
|
||||
)
|
||||
end
|
||||
|
|
|
@ -38,8 +38,8 @@ module Gitlab
|
|||
# Ex.
|
||||
# remove_key("sha-rsa")
|
||||
#
|
||||
def remove_key(key_content)
|
||||
system("/home/git/gitlab-shell/bin/gitlab-keys rm-key \"#{key_content}\"")
|
||||
def remove_key(username, key_content)
|
||||
system("/home/git/gitlab-shell/bin/gitlab-keys rm-key #{username} \"#{key_content}\"")
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Gitlab::GitoliteConfig do
|
||||
let(:gitolite) { Gitlab::GitoliteConfig.new }
|
||||
|
||||
it { should respond_to :write_key }
|
||||
it { should respond_to :rm_key }
|
||||
it { should respond_to :update_project }
|
||||
it { should respond_to :update_project! }
|
||||
it { should respond_to :update_projects }
|
||||
it { should respond_to :destroy_project }
|
||||
it { should respond_to :destroy_project! }
|
||||
it { should respond_to :apply }
|
||||
it { should respond_to :admin_all_repo }
|
||||
it { should respond_to :admin_all_repo! }
|
||||
end
|
|
@ -2,25 +2,17 @@ require 'spec_helper'
|
|||
|
||||
describe Gitlab::Gitolite do
|
||||
let(:project) { double('Project', id: 7, path: 'diaspora') }
|
||||
let(:gitolite_config) { double('Gitlab::GitoliteConfig') }
|
||||
let(:gitolite) { Gitlab::Gitolite.new }
|
||||
|
||||
before do
|
||||
gitolite.stub(config: gitolite_config)
|
||||
Project.stub(find: project)
|
||||
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 :add_repository }
|
||||
it { should respond_to :remove_repository }
|
||||
|
||||
it { gitolite.url_to_repo('diaspora').should == Gitlab.config.gitolite.ssh_path_prefix + "diaspora.git" }
|
||||
|
||||
it "should call config update" do
|
||||
gitolite_config.should_receive(:update_project!)
|
||||
gitolite.update_repository(project.id)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue