debian-mirror-gitlab/spec/features/projects/files/gitignore_dropdown_spec.rb

30 lines
932 B
Ruby
Raw Normal View History

2016-06-02 11:05:42 +05:30
require 'spec_helper'
2017-09-10 17:25:29 +05:30
feature 'User wants to add a .gitignore file' do
2016-06-02 11:05:42 +05:30
before do
user = create(:user)
2017-09-10 17:25:29 +05:30
project = create(:project, :repository)
2016-06-02 11:05:42 +05:30
project.team << [user, :master]
2017-09-10 17:25:29 +05:30
sign_in user
visit project_new_blob_path(project, 'master', file_name: '.gitignore')
2016-06-02 11:05:42 +05:30
end
scenario 'user can see .gitignore dropdown' do
expect(page).to have_css('.gitignore-selector')
end
scenario 'user can pick a .gitignore file from the dropdown', js: true do
find('.js-gitignore-selector').click
2017-09-10 17:25:29 +05:30
wait_for_requests
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
2017-09-10 17:25:29 +05:30
wait_for_requests
2016-06-02 11:05:42 +05:30
2016-08-24 12:49:21 +05:30
expect(page).to have_css('.gitignore-selector .dropdown-toggle-text', text: 'Rails')
2016-06-02 11:05:42 +05:30
expect(page).to have_content('/.bundle')
expect(page).to have_content('# Gemfile.lock, .ruby-version, .ruby-gemset')
end
end