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

31 lines
868 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2016-05-11 20:38:43 -04:00
require 'spec_helper'
describe 'Projects > Files > User wants to add a .gitignore file' do
2016-05-11 20:38:43 -04:00
before do
project = create(:project, :repository)
sign_in project.owner
visit project_new_blob_path(project, 'master', file_name: '.gitignore')
2016-05-11 20:38:43 -04:00
end
it 'user can pick a .gitignore file from the dropdown', :js do
2016-05-11 20:38:43 -04:00
expect(page).to have_css('.gitignore-selector')
find('.js-gitignore-selector').click
wait_for_requests
2016-05-11 20:38:43 -04:00
within '.gitignore-selector' do
find('.dropdown-input-field').set('rails')
find('.dropdown-content li', text: 'Rails').click
end
wait_for_requests
2016-05-11 20:38:43 -04:00
expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Rails')
2016-05-11 20:38:43 -04:00
expect(page).to have_content('/.bundle')
expect(page).to have_content('# Gemfile.lock, .ruby-version, .ruby-gemset')
end
end