Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 17:34:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 17:34:31 +0300
commitc85ab58601ab9ac12cd72fa8a96b298875b37039 (patch)
tree165c7a04f5e77f9aa422667f37e901c960019f65 /spec/support/shared_examples
parent5bc4a1efecfffbd467d7e2e2f42f3f1bf6e6f030 (diff)
Add latest changes from gitlab-org/security/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/support/shared_examples')
-rw-r--r--spec/support/shared_examples/features/secure_oauth_authorizations_shared_examples.rb19
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