Remove instance vars from key model tests

This commit is contained in:
Semyon Pupkov 2016-11-16 00:27:49 +05:00
parent 34a86120ed
commit 2a95184045
1 changed files with 6 additions and 6 deletions

View File

@ -71,15 +71,15 @@ describe Key, models: true do
context 'callbacks' do
it 'adds new key to authorized_file' do
@key = build(:personal_key, id: 7)
expect(GitlabShellWorker).to receive(:perform_async).with(:add_key, @key.shell_id, @key.key)
@key.save
key = build(:personal_key, id: 7)
expect(GitlabShellWorker).to receive(:perform_async).with(:add_key, key.shell_id, key.key)
key.save!
end
it 'removes key from authorized_file' do
@key = create(:personal_key)
expect(GitlabShellWorker).to receive(:perform_async).with(:remove_key, @key.shell_id, @key.key)
@key.destroy
key = create(:personal_key)
expect(GitlabShellWorker).to receive(:perform_async).with(:remove_key, key.shell_id, key.key)
key.destroy
end
end