diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-03 05:52:55 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-03 06:12:05 -0800 |
commit | 4c1231accab556da202a6a7b3e54b3ca0734cefb (patch) | |
tree | 64f1ec71aff0a5d18abd996e6a9664c076162236 /spec/models/ssh_host_key_spec.rb | |
parent | 0cc5e956fcb9393829e537a20be8da89a275ec1d (diff) | |
download | gitlab-ce-4c1231accab556da202a6a7b3e54b3ca0734cefb.tar.gz |
Fix SSH Detect Host Keys not working
Due to a change in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24245, the Detect
Host Key feature in the SSH mirroring stopped working.
`SshHostKey#primary_key` was being used instead of the hard-coded
`:id`. However, `SshHostKey#find_by` was expecting the symbolized `:id`
rather than the string `id`, so it could never find the host key it was
supposed to update.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56855
Diffstat (limited to 'spec/models/ssh_host_key_spec.rb')
-rw-r--r-- | spec/models/ssh_host_key_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/ssh_host_key_spec.rb b/spec/models/ssh_host_key_spec.rb index 75db43b3d56..23a94334172 100644 --- a/spec/models/ssh_host_key_spec.rb +++ b/spec/models/ssh_host_key_spec.rb @@ -50,6 +50,12 @@ describe SshHostKey do subject(:ssh_host_key) { described_class.new(project: project, url: 'ssh://example.com:2222', compare_host_keys: compare_host_keys) } + describe '.primary_key' do + it 'returns a symbol' do + expect(described_class.primary_key).to eq(:id) + end + end + describe '#fingerprints', :use_clean_rails_memory_store_caching do it 'returns an array of indexed fingerprints when the cache is filled' do stub_reactive_cache(ssh_host_key, known_hosts: known_hosts) |