2016-07-19 19:26:41 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-06-29 04:13:10 +00:00
|
|
|
feature 'Ref switcher', js: true do
|
2016-07-19 19:26:41 +00:00
|
|
|
let(:user) { create(:user) }
|
2017-07-24 22:51:14 +00:00
|
|
|
let(:project) { create(:project, :public, :repository) }
|
2016-07-19 19:26:41 +00:00
|
|
|
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(user)
|
2017-07-06 16:20:50 +00:00
|
|
|
visit project_tree_path(project, 'master')
|
2016-07-19 19:26:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'allow user to change ref by enter key' do
|
|
|
|
click_button 'master'
|
2017-05-17 18:25:13 +00:00
|
|
|
wait_for_requests
|
2016-07-19 19:26:41 +00:00
|
|
|
|
|
|
|
page.within '.project-refs-form' do
|
|
|
|
input = find('input[type="search"]')
|
2016-11-07 16:58:50 +00:00
|
|
|
input.set 'binary'
|
2017-05-17 18:25:13 +00:00
|
|
|
wait_for_requests
|
2016-07-19 19:26:41 +00:00
|
|
|
|
2017-07-25 16:57:02 +00:00
|
|
|
expect(find('.dropdown-content ul')).to have_selector('li', count: 7)
|
2017-02-20 10:28:45 +00:00
|
|
|
|
2017-02-10 16:44:42 +00:00
|
|
|
page.within '.dropdown-content ul' do
|
|
|
|
input.native.send_keys :enter
|
|
|
|
end
|
2016-10-28 13:38:10 +00:00
|
|
|
end
|
|
|
|
|
2017-07-25 16:57:02 +00:00
|
|
|
expect(page).to have_title 'add-pdf-text-binary'
|
2016-10-28 13:38:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it "user selects ref with special characters" do
|
|
|
|
click_button 'master'
|
2017-05-17 18:25:13 +00:00
|
|
|
wait_for_requests
|
2016-07-19 19:26:41 +00:00
|
|
|
|
2016-10-28 13:38:10 +00:00
|
|
|
page.within '.project-refs-form' do
|
|
|
|
page.fill_in 'Search branches and tags', with: "'test'"
|
|
|
|
click_link "'test'"
|
2016-07-19 19:26:41 +00:00
|
|
|
end
|
2016-10-28 13:38:10 +00:00
|
|
|
|
|
|
|
expect(page).to have_title "'test'"
|
2016-07-19 19:26:41 +00:00
|
|
|
end
|
|
|
|
end
|