2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-11 20:38:43 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2018-04-06 08:40:33 -04:00
|
|
|
describe 'Projects > Files > User wants to add a .gitignore file' do
|
2016-05-11 20:38:43 -04:00
|
|
|
before do
|
2017-07-24 18:51:14 -04:00
|
|
|
project = create(:project, :repository)
|
2018-04-09 13:26:29 -04:00
|
|
|
sign_in project.owner
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_new_blob_path(project, 'master', file_name: '.gitignore')
|
2016-05-11 20:38:43 -04:00
|
|
|
end
|
|
|
|
|
2018-04-09 13:26:29 -04:00
|
|
|
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
|
2018-04-09 13:26:29 -04:00
|
|
|
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2018-04-09 13:26:29 -04:00
|
|
|
|
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
|
2018-04-09 13:26:29 -04:00
|
|
|
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-05-11 20:38:43 -04:00
|
|
|
|
2019-10-10 05:06:08 -04:00
|
|
|
expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Apply a template')
|
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
|