gitlab-org--gitlab-foss/spec/observers/key_observer_spec.rb
2013-06-25 14:12:38 +03:00

23 lines
509 B
Ruby

require 'spec_helper'
describe KeyObserver do
before do
@key = create(:personal_key)
@observer = KeyObserver.instance
end
context :after_create do
it do
GitlabShellWorker.should_receive(:perform_async).with(:add_key, @key.shell_id, @key.key)
@observer.after_create(@key)
end
end
context :after_destroy do
it do
GitlabShellWorker.should_receive(:perform_async).with(:remove_key, @key.shell_id, @key.key)
@observer.after_destroy(@key)
end
end
end