gitlab_ci_yml_dropdown_spec.rb 905 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' do
4
  before do
5
    project = create(:project, :repository)
Rémy Coutable's avatar
Rémy Coutable committed
6
    sign_in project.owner
7
    visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml')
8 9
  end

Rémy Coutable's avatar
Rémy Coutable committed
10
  it 'user can pick a template from the dropdown', :js do
11 12 13
    expect(page).to have_css('.gitlab-ci-yml-selector')

    find('.js-gitlab-ci-yml-selector').click
Rémy Coutable's avatar
Rémy Coutable committed
14

15
    wait_for_requests
Rémy Coutable's avatar
Rémy Coutable committed
16

17
    within '.gitlab-ci-yml-selector' do
Rémy Coutable's avatar
Rémy Coutable committed
18 19
      find('.dropdown-input-field').set('Jekyll')
      find('.dropdown-content li', text: 'Jekyll').click
20
    end
Rémy Coutable's avatar
Rémy Coutable committed
21

22
    wait_for_requests
23

Rémy Coutable's avatar
Rémy Coutable committed
24
    expect(page).to have_css('.gitlab-ci-yml-selector .dropdown-toggle-text', text: 'Jekyll')
25 26 27 28
    expect(page).to have_content('This file is a template, and might need editing before it works on your project')
    expect(page).to have_content('jekyll build -d test')
  end
end