summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-02-23 12:03:18 +0100
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 15:40:41 +0200
commit597ae6e2208a4910544e5877db7fff300a058886 (patch)
treed250577fad89704b707e92a334a9479d9784276c /spec/features
parenteb77e1068c09cf8ef45689720a2bf200542b8024 (diff)
downloadgitlab-ce-597ae6e2208a4910544e5877db7fff300a058886.tar.gz
feature spec for gpg signed commits
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/commits_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb
index fb1e47994ef..c303f29a832 100644
--- a/spec/features/commits_spec.rb
+++ b/spec/features/commits_spec.rb
@@ -1,4 +1,5 @@
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