gitlab-org--gitlab-foss/spec/features/projects/files/dockerfile_dropdown_spec.rb

32 lines
914 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2016-11-08 07:42:58 -05:00
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a Dockerfile file', :js do
include Spec::Support::Helpers::Features::EditorLiteSpecHelpers
2016-11-08 07:42:58 -05:00
before do
project = create(:project, :repository)
sign_in project.owner
visit project_new_blob_path(project, 'master', file_name: 'Dockerfile')
2016-11-08 07:42:58 -05:00
end
it 'user can pick a Dockerfile file from the dropdown' do
2016-11-08 07:42:58 -05:00
expect(page).to have_css('.dockerfile-selector')
find('.js-dockerfile-selector').click
2017-04-26 11:57:44 -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
wait_for_requests
2016-11-08 07:42:58 -05:00
expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'Apply a template')
expect(editor_get_value).to have_content('COPY ./ /usr/local/apache2/htdocs/')
2016-11-08 07:42:58 -05:00
end
end