diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 14:34:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-26 14:34:31 +0000 |
commit | c85ab58601ab9ac12cd72fa8a96b298875b37039 (patch) | |
tree | 165c7a04f5e77f9aa422667f37e901c960019f65 /spec/support | |
parent | 5bc4a1efecfffbd467d7e2e2f42f3f1bf6e6f030 (diff) | |
download | gitlab-ce-c85ab58601ab9ac12cd72fa8a96b298875b37039.tar.gz |
Add latest changes from gitlab-org/security/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared_examples/features/secure_oauth_authorizations_shared_examples.rb | 19 |
1 files changed, 19 insertions, 0 deletions
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 |