2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
RSpec.describe 'Projects > Files > User wants to add a .gitignore file', :js, feature_category: :projects do
|
2023-06-20 00:43:36 +05:30
|
|
|
include Features::SourceEditorSpecHelpers
|
2021-03-11 19:13:27 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
before do
|
2017-09-10 17:25:29 +05:30
|
|
|
project = create(:project, :repository)
|
2022-04-04 11:22:00 +05:30
|
|
|
sign_in project.first_owner
|
2017-09-10 17:25:29 +05:30
|
|
|
visit project_new_blob_path(project, 'master', file_name: '.gitignore')
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
it 'user can pick a .gitignore file from the dropdown' do
|
2016-06-02 11:05:42 +05:30
|
|
|
expect(page).to have_css('.gitignore-selector')
|
|
|
|
|
|
|
|
find('.js-gitignore-selector').click
|
2018-10-15 14:42:47 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
wait_for_requests
|
2018-10-15 14:42:47 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
within '.gitignore-selector' do
|
|
|
|
find('.dropdown-input-field').set('rails')
|
|
|
|
find('.dropdown-content li', text: 'Rails').click
|
|
|
|
end
|
2018-10-15 14:42:47 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
wait_for_requests
|
2016-06-02 11:05:42 +05:30
|
|
|
|
2019-12-21 20:55:43 +05:30
|
|
|
expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Apply a template')
|
2022-08-13 15:12:31 +05:30
|
|
|
expect(find('.monaco-editor')).to have_content('/.bundle')
|
|
|
|
expect(find('.monaco-editor')).to have_content('config/initializers/secret_token.rb')
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
end
|