Commit 597ae6e2 authored by Alexis Reigel's avatar Alexis Reigel

feature spec for gpg signed commits

parent eb77e106
require 'spec_helper'
require 'fileutils'
describe 'Commits' do
include CiStatusHelper
......@@ -203,4 +204,35 @@ describe 'Commits' do
end
end
end
describe 'GPG signed commits' do
let(:user) { create(:user) }
before do
project.team << [user, :master]
login_with(user)
end
it 'shows the signed status', :gpg do
GPGME::Key.import(GpgHelpers::User1.public_key)
# FIXME: add this to the test repository directly
remote_path = project.repository.path_to_repo
Dir.mktmpdir do |dir|
FileUtils.cd dir do
`git clone --quiet #{remote_path} .`
`git commit --quiet -S#{GpgHelpers::User1.key_id} --allow-empty -m "signed commit, verified key/email"`
`git commit --quiet -S#{GpgHelpers::User2.key_id} --allow-empty -m "signed commit, unverified key/email"`
`git push --quiet`
end
end
visit namespace_project_commits_path(project.namespace, project, :master)
within '#commits-list' do
expect(page).to have_content 'Unverified'
expect(page).to have_content 'Verified'
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