From c85ab58601ab9ac12cd72fa8a96b298875b37039 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 26 May 2020 14:34:31 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@13-0-stable-ee --- .../secure_oauth_authorizations_shared_examples.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spec/support/shared_examples/features/secure_oauth_authorizations_shared_examples.rb (limited to 'spec/support/shared_examples') diff --git a/spec/support/shared_examples/features/secure_oauth_authorizations_shared_examples.rb b/spec/support/shared_examples/features/secure_oauth_authorizations_shared_examples.rb new file mode 100644 index 00000000000..028e075c87a --- /dev/null +++ b/spec/support/shared_examples/features/secure_oauth_authorizations_shared_examples.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'Secure OAuth Authorizations' do + context 'when user is confirmed' do + let(:user) { create(:user) } + + it 'asks the user to authorize the application' do + expect(page).to have_text "Authorize #{application.name} to use your account?" + end + end + + context 'when user is unconfirmed' do + let(:user) { create(:user, confirmed_at: nil) } + + it 'displays an error' do + expect(page).to have_text I18n.t('doorkeeper.errors.messages.unconfirmed_email') + end + end +end -- cgit v1.2.3