summaryrefslogtreecommitdiff
path: root/spec/features/admin/admin_manage_applications_spec.rb
blob: ae41267e5fc0491d619c5505c5ad095137d5c221 (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
require 'spec_helper'

RSpec.describe 'admin manage applications', feature: true do
  before do
    gitlab_sign_in :admin
  end

  it do
    visit admin_applications_path

    click_on 'New application'
    expect(page).to have_content('New application')

    fill_in :doorkeeper_application_name, with: 'test'
    fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com'
    click_on 'Submit'
    expect(page).to have_content('Application: test')
    expect(page).to have_content('Application Id')
    expect(page).to have_content('Secret')

    click_on 'Edit'
    expect(page).to have_content('Edit application')

    fill_in :doorkeeper_application_name, with: 'test_changed'
    click_on 'Submit'
    expect(page).to have_content('test_changed')
    expect(page).to have_content('Application Id')
    expect(page).to have_content('Secret')

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