gitlab-org--gitlab-foss/spec/observers/key_observer_spec.rb

24 lines
509 B
Ruby
Raw Normal View History

require 'spec_helper'
describe KeyObserver do
2013-01-03 05:37:12 -05:00
before do
2013-03-20 04:25:11 -04:00
@key = create(:personal_key)
@observer = KeyObserver.instance
end
2013-06-25 07:12:38 -04:00
context :after_create do
it do
2013-02-11 13:28:27 -05:00
GitlabShellWorker.should_receive(:perform_async).with(:add_key, @key.shell_id, @key.key)
2013-06-25 07:12:38 -04:00
@observer.after_create(@key)
end
end
2013-01-03 05:37:12 -05:00
context :after_destroy do
it do
2013-02-11 13:28:27 -05:00
GitlabShellWorker.should_receive(:perform_async).with(:remove_key, @key.shell_id, @key.key)
@observer.after_destroy(@key)
end
end
end