diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-02 21:13:05 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-02 21:13:05 +0300 |
commit | 6ae2529041258c2d63a992298c9708cc03efd8d1 (patch) | |
tree | 5ca31855e3e15e2e8cb555c4f6b7058da798c0d7 /spec/models/key_spec.rb | |
parent | 77c0a6db4baac1bd91e3636b32b3ffa9d0373211 (diff) | |
download | gitlab-ce-6ae2529041258c2d63a992298c9708cc03efd8d1.tar.gz |
Remove KeysObserver
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r-- | spec/models/key_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 9c872c02a53..c1c6c2f31b7 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -68,4 +68,18 @@ describe Key do build(:invalid_key).should_not be_valid end end + + context 'callbacks' do + it 'should add new key to authorized_file' do + @key = build(:personal_key, id: 7) + GitlabShellWorker.should_receive(:perform_async).with(:add_key, @key.shell_id, @key.key) + @key.save + end + + it 'should remove key from authorized_file' do + @key = create(:personal_key) + GitlabShellWorker.should_receive(:perform_async).with(:remove_key, @key.shell_id, @key.key) + @key.destroy + end + end end |