diff options
author | DJ Mountney <david@twkie.net> | 2016-08-10 11:46:04 -0700 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2016-08-10 11:51:16 -0700 |
commit | 6e4ada2e9e215256dffffc20ec14960c1bbf17e9 (patch) | |
tree | e2b6d99a4a2c8c052f7bde59f061f46b1eda3413 /spec | |
parent | 0b73855f1b83818683f5a1de83090bb043a51616 (diff) | |
download | gitlab-shell-6e4ada2e9e215256dffffc20ec14960c1bbf17e9.tar.gz |
Update the keys permission check to open the file in write mode.
That way the file is created if it does not exist.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/gitlab_keys_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/gitlab_keys_spec.rb b/spec/gitlab_keys_spec.rb index adff6b4..d944278 100644 --- a/spec/gitlab_keys_spec.rb +++ b/spec/gitlab_keys_spec.rb @@ -183,6 +183,13 @@ describe GitlabKeys do gitlab_keys.should_receive(:open_auth_file).and_raise("imaginary error") expect(gitlab_keys.exec).to eq(false) end + + it 'creates the keys file if it does not exist' do + create_authorized_keys_fixture + FileUtils.rm(tmp_authorized_keys_path) + expect(gitlab_keys.exec).to eq(true) + expect(File.exist?(tmp_authorized_keys_path)).to eq(true) + end end describe :exec do |