gitlab-org--gitlab-foss/spec/features/projects/ref_switcher_spec.rb
Jacopo ff76adb547 Unnecessary "include WaitForAjax" and "include ApiHelpers"
Removed all the unnecessary include of `WaitForAjax` and `ApiHelpers` in the specs.
Removed unnecessary usage of `api:true`
2017-04-21 22:32:02 +02:00

43 lines
1 KiB
Ruby

require 'rails_helper'
feature 'Ref switcher', feature: true, js: true do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
before do
project.team << [user, :master]
login_as(user)
visit namespace_project_tree_path(project.namespace, project, 'master')
end
it 'allow user to change ref by enter key' do
click_button 'master'
wait_for_ajax
page.within '.project-refs-form' do
input = find('input[type="search"]')
input.set 'binary'
wait_for_ajax
expect(find('.dropdown-content ul')).to have_selector('li', count: 6)
page.within '.dropdown-content ul' do
input.native.send_keys :enter
end
end
expect(page).to have_title 'binary-encoding'
end
it "user selects ref with special characters" do
click_button 'master'
wait_for_ajax
page.within '.project-refs-form' do
page.fill_in 'Search branches and tags', with: "'test'"
click_link "'test'"
end
expect(page).to have_title "'test'"
end
end