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

user_manages_applications_spec.rb « profiles « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d65365db88053ee4740010831bbdcedb5d68d2a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'User manages applications' do
  let(:user) { create(:user) }

  before do
    sign_in(user)
    visit applications_profile_path
  end

  it 'manages applications' do
    expect(page).to have_content 'Add new application'

    fill_in :doorkeeper_application_name,         with: 'test'
    fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com'
    click_on 'Save application'

    expect(page).to have_content 'Application: test'
    expect(page).to have_content 'Application ID'
    expect(page).to have_content 'Secret'
    expect(page).to have_content 'Confidential Yes'

    click_on 'Edit'

    expect(page).to have_content 'Edit application'
    fill_in :doorkeeper_application_name, with: 'test_changed'
    uncheck :doorkeeper_application_confidential
    click_on 'Save application'

    expect(page).to have_content 'test_changed'
    expect(page).to have_content 'Application ID'
    expect(page).to have_content 'Secret'
    expect(page).to have_content 'Confidential No'

    visit applications_profile_path

    page.within '.oauth-applications' do
      click_on 'Destroy'
    end
    expect(page.find('.oauth-applications')).not_to have_content 'test_changed'
  end
end