diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-29 01:03:38 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-29 01:03:38 +0400 |
commit | 1c931fb81477397929a31a6b95c5d65b6d582182 (patch) | |
tree | 9ad7fc2df051aec24c5d51dce3356f7bba930642 /spec | |
parent | 299a9a10400e7fdcc641a90db95290322058c529 (diff) |
fix key observer tests
Diffstat (limited to 'spec')
-rw-r--r-- | spec/observers/key_observer_spec.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/spec/observers/key_observer_spec.rb b/spec/observers/key_observer_spec.rb index ae7b0f73e57..11f975cc57d 100644 --- a/spec/observers/key_observer_spec.rb +++ b/spec/observers/key_observer_spec.rb @@ -9,25 +9,19 @@ describe KeyObserver do is_deploy_key: false ) - @gitolite = double('Gitlab::Gitolite', - set_key: true, - remove_key: true - ) - @observer = KeyObserver.instance - @observer.stub(gitolite: @gitolite) end context :after_save do it do - @gitolite.should_receive(:set_key).with(@key.identifier, @key.key, @key.projects) + GitoliteWorker.should_receive(:perform_async).with(:set_key, @key.identifier, @key.key, @key.projects.map(&:id)) @observer.after_save(@key) end end context :after_destroy do it do - @gitolite.should_receive(:remove_key).with(@key.identifier, @key.projects) + GitoliteWorker.should_receive(:perform_async).with(:remove_key, @key.identifier, @key.projects.map(&:id)) @observer.after_destroy(@key) end end |