BigW Consortium Gitlab

dockerfile_dropdown_spec.rb 931 Bytes
Newer Older
Luke "Jared" Bennett committed
1
require 'spec_helper'
2
require 'fileutils'
Luke "Jared" Bennett committed
3 4 5 6 7 8

feature 'User wants to add a Dockerfile file', feature: true do
  before do
    user = create(:user)
    project = create(:project)
    project.team << [user, :master]
9

Luke "Jared" Bennett committed
10
    login_as user
11

Luke "Jared" Bennett committed
12 13 14 15 16 17 18 19 20
    visit namespace_project_new_blob_path(project.namespace, project, 'master', file_name: 'Dockerfile')
  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
21

Luke "Jared" Bennett committed
22
    wait_for_ajax
23

Luke "Jared" Bennett committed
24 25 26 27
    within '.dockerfile-selector' do
      find('.dropdown-input-field').set('HTTPd')
      find('.dropdown-content li', text: 'HTTPd').click
    end
28

Luke "Jared" Bennett committed
29 30 31 32 33 34
    wait_for_ajax

    expect(page).to have_css('.dockerfile-selector .dropdown-toggle-text', text: 'HTTPd')
    expect(page).to have_content('COPY ./ /usr/local/apache2/htdocs/')
  end
end