debian-mirror-gitlab/spec/features/projects/ref_switcher_spec.rb

44 lines
1 KiB
Ruby
Raw Normal View History

2016-09-13 17:45:13 +05:30
require 'rails_helper'
2017-09-10 17:25:29 +05:30
feature 'Ref switcher', js: true do
2016-09-13 17:45:13 +05:30
let(:user) { create(:user) }
2017-09-10 17:25:29 +05:30
let(:project) { create(:project, :public, :repository) }
2016-09-13 17:45:13 +05:30
before do
project.team << [user, :master]
2017-09-10 17:25:29 +05:30
sign_in(user)
visit project_tree_path(project, 'master')
2016-09-13 17:45:13 +05:30
end
it 'allow user to change ref by enter key' do
click_button 'master'
2017-09-10 17:25:29 +05:30
wait_for_requests
2016-09-13 17:45:13 +05:30
page.within '.project-refs-form' do
input = find('input[type="search"]')
2017-08-17 22:00:37 +05:30
input.set 'binary'
2017-09-10 17:25:29 +05:30
wait_for_requests
2016-09-13 17:45:13 +05:30
2017-09-10 17:25:29 +05:30
expect(find('.dropdown-content ul')).to have_selector('li', count: 7)
2017-08-17 22:00:37 +05:30
page.within '.dropdown-content ul' do
input.native.send_keys :enter
end
2016-11-24 13:41:30 +05:30
end
2017-09-10 17:25:29 +05:30
expect(page).to have_title 'add-pdf-text-binary'
2016-11-24 13:41:30 +05:30
end
it "user selects ref with special characters" do
click_button 'master'
2017-09-10 17:25:29 +05:30
wait_for_requests
2016-09-13 17:45:13 +05:30
2016-11-24 13:41:30 +05:30
page.within '.project-refs-form' do
page.fill_in 'Search branches and tags', with: "'test'"
click_link "'test'"
2016-09-13 17:45:13 +05:30
end
2016-11-24 13:41:30 +05:30
expect(page).to have_title "'test'"
2016-09-13 17:45:13 +05:30
end
end