2016-11-08 07:42:58 -05:00
|
|
|
require 'spec_helper'
|
2017-04-26 11:57:44 -04:00
|
|
|
require 'fileutils'
|
2016-11-08 07:42:58 -05:00
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
feature 'User wants to add a Dockerfile file' do
|
2016-11-08 07:42:58 -05:00
|
|
|
before do
|
|
|
|
user = create(:user)
|
2017-07-24 18:51:14 -04:00
|
|
|
project = create(:project, :repository)
|
2016-11-08 07:42:58 -05:00
|
|
|
project.team << [user, :master]
|
2017-04-26 11:57:44 -04:00
|
|
|
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in user
|
2017-04-26 11:57:44 -04:00
|
|
|
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_new_blob_path(project, 'master', file_name: 'Dockerfile')
|
2016-11-08 07:42:58 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'user can see Dockerfile dropdown' do
|
|
|
|
expect(page).to have_css('.dockerfile-selector')
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'user can pick a Dockerfile file from the dropdown', js: true do
|
|
|
|
find('.js-dockerfile-selector').click
|
2017-04-26 11:57:44 -04:00
|
|
|
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2017-04-26 11:57:44 -04:00
|
|
|
|
2016-11-08 07:42:58 -05:00
|
|
|
within '.dockerfile-selector' do
|
|
|
|
find('.dropdown-input-field').set('HTTPd')
|
|
|
|
find('.dropdown-content li', text: 'HTTPd').click
|
|
|
|
end
|
2017-04-26 11:57:44 -04:00
|
|
|
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-11-08 07:42:58 -05:00
|
|
|
|
|
|
|
expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'HTTPd')
|
|
|
|
expect(page).to have_content('COPY ./ /usr/local/apache2/htdocs/')
|
|
|
|
end
|
|
|
|
end
|