Fixed: post-receive, project remove, tests
This commit is contained in:
parent
39e37677f2
commit
70e3bffd95
9 changed files with 43 additions and 47 deletions
|
@ -3,7 +3,7 @@ require 'spec_helper'
|
|||
describe KeyObserver do
|
||||
before do
|
||||
@key = double('Key',
|
||||
identifier: 'admin_654654',
|
||||
shell_id: 'key-32',
|
||||
key: '== a vaild ssh key',
|
||||
projects: [],
|
||||
is_deploy_key: false
|
||||
|
@ -14,14 +14,14 @@ describe KeyObserver do
|
|||
|
||||
context :after_save do
|
||||
it do
|
||||
GitoliteWorker.should_receive(:perform_async).with(:set_key, @key.identifier, @key.key, @key.projects.map(&:id))
|
||||
GitoliteWorker.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.identifier, @key.projects.map(&:id))
|
||||
GitoliteWorker.should_receive(:perform_async).with(:remove_key, @key.shell_id, @key.key)
|
||||
@observer.after_destroy(@key)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue