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

deploy_token_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: fd77297a49058cdfa6d9abb21de9df8cb97a79f1 (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
# frozen_string_literal: true

RSpec.shared_examples 'a deploy token in settings' do
  it 'view deploy tokens' do
    within('.deploy-tokens') do
      expect(page).to have_content(deploy_token.name)
      expect(page).to have_content('read_repository')
      expect(page).to have_content('read_registry')
    end
  end

  it 'add a new deploy token' do
    fill_in 'deploy_token_name', with: 'new_deploy_key'
    fill_in 'deploy_token_expires_at', with: (Date.today + 1.month).to_s
    fill_in 'deploy_token_username', with: 'deployer'
    check 'deploy_token_read_repository'
    check 'deploy_token_read_registry'
    click_button 'Create deploy token'

    expect(page).to have_content("Your new #{entity_type} deploy token has been created")

    within('.created-deploy-token-container') do
      expect(page).to have_selector("input[name='deploy-token-user'][value='deployer']")
      expect(page).to have_selector("input[name='deploy-token'][readonly='readonly']")
    end
  end
end