2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', :js do
|
2021-09-30 23:02:18 +05:30
|
|
|
include Spec::Support::Helpers::Features::SourceEditorSpecHelpers
|
2021-03-11 19:13:27 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
before do
|
2017-09-10 17:25:29 +05:30
|
|
|
project = create(:project, :repository)
|
2018-10-15 14:42:47 +05:30
|
|
|
sign_in project.owner
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_new_blob_path(project, 'master', file_name: 'Dockerfile')
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
it 'user can pick a Dockerfile file from the dropdown' do
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(page).to have_css('.dockerfile-selector')
|
|
|
|
|
|
|
|
find('.js-dockerfile-selector').click
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
wait_for_requests
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
within '.dockerfile-selector' do
|
|
|
|
find('.dropdown-input-field').set('HTTPd')
|
|
|
|
find('.dropdown-content li', text: 'HTTPd').click
|
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
wait_for_requests
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'Apply a template')
|
2021-03-11 19:13:27 +05:30
|
|
|
expect(editor_get_value).to have_content('COPY ./ /usr/local/apache2/htdocs/')
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
end
|