BigW Consortium Gitlab

Commit 5ce61120 by Alexis Reigel

use example gpg key instead of my own

parent 597ae6e2
......@@ -16,8 +16,8 @@ feature 'Profile > GPG Keys', :gpg do
fill_in('Key', with: attributes_for(:gpg_key)[:key])
click_button('Add key')
expect(page).to have_content('mail@koffeinfrei.org lex@panter.ch')
expect(page).to have_content('4F4840A503964251CF7D7F5DC728AF10972E97C0')
expect(page).to have_content(GpgHelpers::User1.email)
expect(page).to have_content(GpgHelpers::User1.fingerprint)
end
end
......@@ -25,8 +25,8 @@ feature 'Profile > GPG Keys', :gpg do
create(:gpg_key, user: user)
visit profile_gpg_keys_path
expect(page).to have_content('mail@koffeinfrei.org lex@panter.ch')
expect(page).to have_content('4F4840A503964251CF7D7F5DC728AF10972E97C0')
expect(page).to have_content(GpgHelpers::User1.email)
expect(page).to have_content(GpgHelpers::User1.fingerprint)
end
scenario 'User removes a key via the key index' do
......
......@@ -5,7 +5,7 @@ describe Gitlab::Gpg do
it 'returns the fingerprint' do
expect(
described_class.fingerprints_from_key(GpgHelpers::User1.public_key)
).to eq ['4F4840A503964251CF7D7F5DC728AF10972E97C0']
).to eq [GpgHelpers::User1.fingerprint]
end
it 'returns an empty array when the key is invalid' do
......@@ -17,22 +17,22 @@ describe Gitlab::Gpg do
describe '.add_to_keychain', :gpg do
it 'stores the key in the keychain' do
expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).to eq []
expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).to eq []
Gitlab::Gpg.add_to_keychain(GpgHelpers::User1.public_key)
expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).not_to eq []
expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).not_to eq []
end
end
describe '.remove_from_keychain', :gpg do
it 'removes the key from the keychain' do
Gitlab::Gpg.add_to_keychain(GpgHelpers::User1.public_key)
expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).not_to eq []
expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).not_to eq []
Gitlab::Gpg.remove_from_keychain('4F4840A503964251CF7D7F5DC728AF10972E97C0')
Gitlab::Gpg.remove_from_keychain(GpgHelpers::User1.fingerprint)
expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).to eq []
expect(GPGME::Key.find(:public, GpgHelpers::User1.fingerprint)).to eq []
end
end
end
......@@ -18,7 +18,7 @@ describe GpgKey do
it 'extracts the fingerprint from the gpg key' do
gpg_key = described_class.new(key: GpgHelpers::User1.public_key)
gpg_key.valid?
expect(gpg_key.fingerprint).to eq '4F4840A503964251CF7D7F5DC728AF10972E97C0'
expect(gpg_key.fingerprint).to eq GpgHelpers::User1.fingerprint
end
end
......@@ -34,7 +34,7 @@ describe GpgKey do
allow(Gitlab::Gpg).to receive :add_to_keychain
gpg_key = create :gpg_key
expect(Gitlab::Gpg).to receive(:remove_from_keychain).with('4F4840A503964251CF7D7F5DC728AF10972E97C0')
expect(Gitlab::Gpg).to receive(:remove_from_keychain).with(GpgHelpers::User1.fingerprint)
gpg_key.destroy!
end
......@@ -57,9 +57,9 @@ describe GpgKey do
describe '#emails', :gpg do
it 'returns the emails from the gpg key' do
gpg_key = create :gpg_key
gpg_key = create :gpg_key, key: GpgHelpers::User1.public_key
expect(gpg_key.emails).to match_array %w(mail@koffeinfrei.org lex@panter.ch)
expect(gpg_key.emails).to eq [GpgHelpers::User1.email]
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