2016-07-19 15:26:41 -04:00
|
|
|
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'
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-07-19 15:26:41 -04:00
|
|
|
|
|
|
|
page.within '.project-refs-form' do
|
|
|
|
input = find('input[type="search"]')
|
2016-11-07 11:58:50 -05:00
|
|
|
input.set 'binary'
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-07-19 15:26:41 -04:00
|
|
|
|
2017-02-20 05:28:45 -05:00
|
|
|
expect(find('.dropdown-content ul')).to have_selector('li', count: 6)
|
|
|
|
|
2017-02-10 11:44:42 -05:00
|
|
|
page.within '.dropdown-content ul' do
|
|
|
|
input.native.send_keys :enter
|
|
|
|
end
|
2016-10-28 09:38:10 -04:00
|
|
|
end
|
|
|
|
|
2016-11-07 11:58:50 -05:00
|
|
|
expect(page).to have_title 'binary-encoding'
|
2016-10-28 09:38:10 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "user selects ref with special characters" do
|
|
|
|
click_button 'master'
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-07-19 15:26:41 -04:00
|
|
|
|
2016-10-28 09:38:10 -04:00
|
|
|
page.within '.project-refs-form' do
|
|
|
|
page.fill_in 'Search branches and tags', with: "'test'"
|
|
|
|
click_link "'test'"
|
2016-07-19 15:26:41 -04:00
|
|
|
end
|
2016-10-28 09:38:10 -04:00
|
|
|
|
|
|
|
expect(page).to have_title "'test'"
|
2016-07-19 15:26:41 -04:00
|
|
|
end
|
|
|
|
end
|