summaryrefslogtreecommitdiff
path: root/spec/models/key_spec.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-04-02 21:13:05 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-04-02 21:13:05 +0300
commit6ae2529041258c2d63a992298c9708cc03efd8d1 (patch)
tree5ca31855e3e15e2e8cb555c4f6b7058da798c0d7 /spec/models/key_spec.rb
parent77c0a6db4baac1bd91e3636b32b3ffa9d0373211 (diff)
downloadgitlab-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.rb14
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