summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-02-28 15:25:12 +0100
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 15:42:04 +0200
commit8bd94a7304d392ad030295b5dfcd84c0100eddd1 (patch)
tree0e08bcdb460ad21c25646f686a42f4b743bf0129 /spec/features
parentc1281982bd7975b45bed5b8e2c5ef5e242ea18fd (diff)
downloadgitlab-ce-8bd94a7304d392ad030295b5dfcd84c0100eddd1.tar.gz
remove gpg from keychain when user's email changes
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/commits_spec.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb
index c303f29a832..79952eda2ff 100644
--- a/spec/features/commits_spec.rb
+++ b/spec/features/commits_spec.rb
@@ -206,7 +206,8 @@ describe 'Commits' do
end
describe 'GPG signed commits' do
- let(:user) { create(:user) }
+ let!(:user) { create :user, email: GpgHelpers::User1.emails.first }
+ let!(:gpg_key) { create :gpg_key, key: GpgHelpers::User1.public_key, user: user }
before do
project.team << [user, :master]
@@ -214,8 +215,6 @@ describe 'Commits' do
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|
@@ -233,6 +232,17 @@ describe 'Commits' do
expect(page).to have_content 'Unverified'
expect(page).to have_content 'Verified'
end
+
+ # user changes his email which makes the gpg key unverified
+ user.skip_reconfirmation!
+ user.update_attributes!(email: 'bette.cartwright@example.org')
+
+ visit namespace_project_commits_path(project.namespace, project, :master)
+
+ within '#commits-list' do
+ expect(page).to have_content 'Unverified'
+ expect(page).not_to have_content 'Verified'
+ end
end
end
end