BigW Consortium Gitlab

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

3
feature 'User wants to add a .gitlab-ci.yml file' do
4 5
  before do
    user = create(:user)
6
    project = create(:project, :repository)
7
    project.team << [user, :master]
8
    sign_in user
9
    visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml')
10 11 12 13 14 15 16 17
  end

  scenario 'user can see .gitlab-ci.yml dropdown' do
    expect(page).to have_css('.gitlab-ci-yml-selector')
  end

  scenario 'user can pick a template from the dropdown', js: true do
    find('.js-gitlab-ci-yml-selector').click
18
    wait_for_requests
19
    within '.gitlab-ci-yml-selector' do
Rémy Coutable committed
20 21
      find('.dropdown-input-field').set('Jekyll')
      find('.dropdown-content li', text: 'Jekyll').click
22
    end
23
    wait_for_requests
24

Rémy Coutable committed
25
    expect(page).to have_css('.gitlab-ci-yml-selector .dropdown-toggle-text', text: 'Jekyll')
26 27 28 29
    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