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

secure_oauth_authorizations_shared_examples.rb « features « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 231406289b41bca78fdf4d4263c66f802f8f0a26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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, :unconfirmed) }

    it 'displays an error' do
      expect(page).to have_text I18n.t('doorkeeper.errors.messages.unconfirmed_email')
    end
  end
end