blob: 406fa52e723d9d397d31c052e433665f2046cbca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
require 'spec_helper'
describe 'New Branch Ref Dropdown', :js, :feature do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let(:toggle) { find('.create-from .dropdown-menu-toggle') }
before do
project.add_master(user)
gitlab_sign_in(user)
visit new_namespace_project_branch_path(project.namespace, project)
end
it 'filters a list of branches and tags' do
toggle.click
filter_by('v1.0.0')
expect(items_count).to be(1)
filter_by('video')
expect(items_count).to be(1)
find('.create-from .dropdown-content li').click
expect(toggle).to have_content 'video'
end
it 'accepts a manually entered commit SHA' do
toggle.click
filter_by('somecommitsha')
find('.create-from input[type=search]').send_keys(:enter)
expect(toggle).to have_content 'somecommitsha'
end
def items_count
all('.create-from .dropdown-content li').length
end
def filter_by(filter_text)
fill_in 'Filter by Git revision', with: filter_text
end
end
|