2019-07-25 05:24:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-16 23:53:41 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 18:09:01 +00:00
|
|
|
RSpec.describe 'Projects > Files > User wants to add a .gitlab-ci.yml file' do
|
2016-06-16 23:53:41 +00:00
|
|
|
before do
|
2017-07-24 22:51:14 +00:00
|
|
|
project = create(:project, :repository)
|
2018-04-09 17:26:29 +00:00
|
|
|
sign_in project.owner
|
2017-07-06 16:20:50 +00:00
|
|
|
visit project_new_blob_path(project, 'master', file_name: '.gitlab-ci.yml')
|
2016-06-16 23:53:41 +00:00
|
|
|
end
|
|
|
|
|
2018-04-09 17:26:29 +00:00
|
|
|
it 'user can pick a template from the dropdown', :js do
|
2016-06-16 23:53:41 +00:00
|
|
|
expect(page).to have_css('.gitlab-ci-yml-selector')
|
|
|
|
|
|
|
|
find('.js-gitlab-ci-yml-selector').click
|
2018-04-09 17:26:29 +00:00
|
|
|
|
2017-05-17 18:25:13 +00:00
|
|
|
wait_for_requests
|
2018-04-09 17:26:29 +00:00
|
|
|
|
2016-06-16 23:53:41 +00:00
|
|
|
within '.gitlab-ci-yml-selector' do
|
2016-07-06 15:52:59 +00:00
|
|
|
find('.dropdown-input-field').set('Jekyll')
|
|
|
|
find('.dropdown-content li', text: 'Jekyll').click
|
2016-06-16 23:53:41 +00:00
|
|
|
end
|
2018-04-09 17:26:29 +00:00
|
|
|
|
2017-05-17 18:25:13 +00:00
|
|
|
wait_for_requests
|
2016-06-16 23:53:41 +00:00
|
|
|
|
2019-10-10 09:06:08 +00:00
|
|
|
expect(page).to have_css('.gitlab-ci-yml-selector .dropdown-toggle-text', text: 'Apply a template')
|
2016-06-16 23:53:41 +00:00
|
|
|
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
|