summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSemyon Pupkov <mail@semyonpupkov.com>2016-11-16 00:27:49 +0500
committerSemyon Pupkov <mail@semyonpupkov.com>2016-11-16 00:59:09 +0500
commit2a951840451cf86f3ddfa4675cb3a5e360b89867 (patch)
treeb2d4ff31185a68e12b713f439ff443493e0c184b /spec
parent34a86120ed52b5e77ef2cd51a60bed1208671639 (diff)
downloadgitlab-ce-2a951840451cf86f3ddfa4675cb3a5e360b89867.tar.gz
Remove instance vars from key model tests
Diffstat (limited to 'spec')
-rw-r--r--spec/models/key_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb
index ba9cdf7dddb..1a26cee9f3d 100644
--- a/spec/models/key_spec.rb
+++ b/spec/models/key_spec.rb
@@ -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