Commit 85c6652a authored by Rubén Dávila's avatar Rubén Dávila

Fix some broken specs

parent c50725fe
...@@ -119,7 +119,7 @@ class GpgKey < ActiveRecord::Base ...@@ -119,7 +119,7 @@ class GpgKey < ActiveRecord::Base
def generate_subkeys def generate_subkeys
gpg_subkeys = Gitlab::Gpg.subkeys_from_key(key) gpg_subkeys = Gitlab::Gpg.subkeys_from_key(key)
gpg_subkeys[primary_keyid].each do |subkey_data| gpg_subkeys[primary_keyid]&.each do |subkey_data|
subkeys.create!(keyid: subkey_data[:keyid], fingerprint: subkey_data[:fingerprint]) subkeys.create!(keyid: subkey_data[:keyid], fingerprint: subkey_data[:fingerprint])
end end
end end
......
...@@ -4,7 +4,7 @@ FactoryGirl.define do ...@@ -4,7 +4,7 @@ FactoryGirl.define do
factory :gpg_key_subkey do factory :gpg_key_subkey do
gpg_key gpg_key
keyid { gpg_key.subkeys.last.keyid } sequence(:keyid) { |n| "keyid-#{n}" }
fingerprint { gpg_key.subkeys.last.fingerprint } sequence(:fingerprint) { |n| "fingerprint-#{n}" }
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