debian-mirror-gitlab/spec/features/projects/files/dockerfile_dropdown_spec.rb

35 lines
907 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
require 'fileutils'
2017-09-10 17:25:29 +05:30
feature 'User wants to add a Dockerfile file' do
2017-08-17 22:00:37 +05:30
before do
user = create(:user)
2017-09-10 17:25:29 +05:30
project = create(:project, :repository)
2017-08-17 22:00:37 +05:30
project.team << [user, :master]
2017-09-10 17:25:29 +05:30
sign_in user
2017-08-17 22:00:37 +05:30
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
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-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
expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'HTTPd')
expect(page).to have_content('COPY ./ /usr/local/apache2/htdocs/')
end
end