blob: eedb79167bd2c08fe05394c27b8e72e376c68ab2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Projects > Files > User wants to add a .gitignore file', :js, feature_category: :projects do
include Features::SourceEditorSpecHelpers
before do
project = create(:project, :repository)
sign_in project.first_owner
visit project_new_blob_path(project, 'master', file_name: '.gitignore')
end
it 'user can pick a .gitignore file from the dropdown' do
expect(page).to have_css('.gitignore-selector')
find('.js-gitignore-selector').click
wait_for_requests
within '.gitignore-selector' do
find('.dropdown-input-field').set('rails')
find('.dropdown-content li', text: 'Rails').click
end
wait_for_requests
expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Apply a template')
expect(find('.monaco-editor')).to have_content('/.bundle')
expect(find('.monaco-editor')).to have_content('config/initializers/secret_token.rb')
end
end
|