Fixed: post-receive, project remove, tests

This commit is contained in:
Dmitriy Zaporozhets 2013-02-05 12:47:50 +02:00
parent 39e37677f2
commit 70e3bffd95
9 changed files with 43 additions and 47 deletions

View file

@ -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