Commit 2a951840 authored by Semyon Pupkov's avatar Semyon Pupkov

Remove instance vars from key model tests

parent 34a86120
...@@ -71,15 +71,15 @@ describe Key, models: true do ...@@ -71,15 +71,15 @@ describe Key, models: true do
context 'callbacks' do context 'callbacks' do
it 'adds new key to authorized_file' do it 'adds new key to authorized_file' do
@key = build(:personal_key, id: 7) key = build(:personal_key, id: 7)
expect(GitlabShellWorker).to receive(:perform_async).with(:add_key, @key.shell_id, @key.key) expect(GitlabShellWorker).to receive(:perform_async).with(:add_key, key.shell_id, key.key)
@key.save key.save!
end end
it 'removes key from authorized_file' do it 'removes key from authorized_file' do
@key = create(:personal_key) key = create(:personal_key)
expect(GitlabShellWorker).to receive(:perform_async).with(:remove_key, @key.shell_id, @key.key) expect(GitlabShellWorker).to receive(:perform_async).with(:remove_key, key.shell_id, key.key)
@key.destroy key.destroy
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment