Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
51da74b7
Commit
51da74b7
authored
Sep 15, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Fix the default branches sorting to actually be 'Last updated'
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
30818f47
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
211 additions
and
218 deletions
+211
-218
app/controllers/projects/branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
changelogs/unreleased/26890-fix-default-branches-sorting.yml
changelogs/unreleased/26890-fix-default-branches-sorting.yml
+5
-0
spec/ee/support/protected_branch_helpers.rb
spec/ee/support/protected_branch_helpers.rb
+14
-0
spec/features/projects/branches/download_buttons_spec.rb
spec/features/projects/branches/download_buttons_spec.rb
+1
-1
spec/features/projects/branches_spec.rb
spec/features/projects/branches_spec.rb
+14
-82
spec/features/protected_branches_spec.rb
spec/features/protected_branches_spec.rb
+176
-116
spec/support/protected_branch_helpers.rb
spec/support/protected_branch_helpers.rb
+0
-18
No files found.
app/controllers/projects/branches_controller.rb
View file @
51da74b7
...
@@ -9,7 +9,7 @@ class Projects::BranchesController < Projects::ApplicationController
...
@@ -9,7 +9,7 @@ class Projects::BranchesController < Projects::ApplicationController
def
index
def
index
@sort
=
params
[
:sort
].
presence
||
sort_value_recently_updated
@sort
=
params
[
:sort
].
presence
||
sort_value_recently_updated
@branches
=
BranchesFinder
.
new
(
@repository
,
params
).
execute
@branches
=
BranchesFinder
.
new
(
@repository
,
params
.
merge
(
sort:
@sort
)
).
execute
@branches
=
Kaminari
.
paginate_array
(
@branches
).
page
(
params
[
:page
])
@branches
=
Kaminari
.
paginate_array
(
@branches
).
page
(
params
[
:page
])
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
changelogs/unreleased/26890-fix-default-branches-sorting.yml
0 → 100644
View file @
51da74b7
---
title
:
Fix the default branches sorting to actually be 'Last updated'
merge_request
:
14295
author
:
type
:
fixed
spec/ee/support/protected_branch_helpers.rb
0 → 100644
View file @
51da74b7
module
EE
module
ProtectedBranchHelpers
def
set_allowed_to
(
operation
,
option
=
'Masters'
,
form:
'.js-new-protected-branch'
)
within
form
do
find
(
".js-allowed-to-
#{
operation
}
"
).
trigger
(
'click'
)
wait_for_requests
Array
(
option
).
each
{
|
opt
|
click_on
(
opt
)
}
find
(
".js-allowed-to-
#{
operation
}
"
).
trigger
(
'click'
)
# needed to submit form in some cases
end
end
end
end
spec/features/projects/branches/download_buttons_spec.rb
View file @
51da74b7
...
@@ -29,7 +29,7 @@ feature 'Download buttons in branches page' do
...
@@ -29,7 +29,7 @@ feature 'Download buttons in branches page' do
describe
'when checking branches'
do
describe
'when checking branches'
do
context
'with artifacts'
do
context
'with artifacts'
do
before
do
before
do
visit
project_branches_path
(
project
)
visit
project_branches_path
(
project
,
search:
'binary-encoding'
)
end
end
scenario
'shows download artifacts button'
do
scenario
'shows download artifacts button'
do
...
...
spec/features/projects/branches_spec.rb
View file @
51da74b7
require
'spec_helper'
require
'spec_helper'
describe
'Branches'
do
describe
'Branches'
do
include
ProtectedBranchHelpers
include
EE
::
ProtectedBranchHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
...
@@ -14,12 +14,10 @@ describe 'Branches' do
...
@@ -14,12 +14,10 @@ describe 'Branches' do
end
end
describe
'Initial branches page'
do
describe
'Initial branches page'
do
it
'shows all the branches'
do
it
'shows all the branches
sorted by last updated by default
'
do
visit
project_branches_path
(
project
)
visit
project_branches_path
(
project
)
repository
.
branches_sorted_by
(
:name
).
first
(
20
).
each
do
|
branch
|
expect
(
page
).
to
have_content
(
sorted_branches
(
repository
,
count:
20
,
sort_by: :updated_desc
))
expect
(
page
).
to
have_content
(
"
#{
branch
.
name
}
"
)
end
end
end
it
'sorts the branches by name'
do
it
'sorts the branches by name'
do
...
@@ -28,22 +26,7 @@ describe 'Branches' do
...
@@ -28,22 +26,7 @@ describe 'Branches' do
click_button
"Last updated"
# Open sorting dropdown
click_button
"Last updated"
# Open sorting dropdown
click_link
"Name"
click_link
"Name"
sorted
=
repository
.
branches_sorted_by
(
:name
).
first
(
20
).
map
do
|
branch
|
expect
(
page
).
to
have_content
(
sorted_branches
(
repository
,
count:
20
,
sort_by: :name
))
Regexp
.
escape
(
branch
.
name
)
end
expect
(
page
).
to
have_content
(
/
#{
sorted
.
join
(
".*"
)
}
/
)
end
it
'sorts the branches by last updated'
do
visit
project_branches_path
(
project
)
click_button
"Last updated"
# Open sorting dropdown
click_link
"Last updated"
sorted
=
repository
.
branches_sorted_by
(
:updated_desc
).
first
(
20
).
map
do
|
branch
|
Regexp
.
escape
(
branch
.
name
)
end
expect
(
page
).
to
have_content
(
/
#{
sorted
.
join
(
".*"
)
}
/
)
end
end
it
'sorts the branches by oldest updated'
do
it
'sorts the branches by oldest updated'
do
...
@@ -52,10 +35,7 @@ describe 'Branches' do
...
@@ -52,10 +35,7 @@ describe 'Branches' do
click_button
"Last updated"
# Open sorting dropdown
click_button
"Last updated"
# Open sorting dropdown
click_link
"Oldest updated"
click_link
"Oldest updated"
sorted
=
repository
.
branches_sorted_by
(
:updated_asc
).
first
(
20
).
map
do
|
branch
|
expect
(
page
).
to
have_content
(
sorted_branches
(
repository
,
count:
20
,
sort_by: :updated_asc
))
Regexp
.
escape
(
branch
.
name
)
end
expect
(
page
).
to
have_content
(
/
#{
sorted
.
join
(
".*"
)
}
/
)
end
end
it
'avoids a N+1 query in branches index'
do
it
'avoids a N+1 query in branches index'
do
...
@@ -95,30 +75,6 @@ describe 'Branches' do
...
@@ -95,30 +75,6 @@ describe 'Branches' do
expect
(
find
(
'.all-branches'
)).
to
have_selector
(
'li'
,
count:
0
)
expect
(
find
(
'.all-branches'
)).
to
have_selector
(
'li'
,
count:
0
)
end
end
end
end
describe
'Delete protected branch'
do
before
do
project
.
add_user
(
user
,
:master
)
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'fix'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'fix'
)
}
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
project
.
add_user
(
user
,
:developer
)
end
it
'does not allow devleoper to remove protected branch'
,
js:
true
do
visit
project_branches_path
(
project
)
fill_in
'branch-search'
,
with:
'fix'
find
(
'#branch-search'
).
native
.
send_keys
(
:enter
)
expect
(
page
).
to
have_css
(
'.btn-remove.disabled'
)
end
end
end
end
context
'logged in as master'
do
context
'logged in as master'
do
...
@@ -134,39 +90,6 @@ describe 'Branches' do
...
@@ -134,39 +90,6 @@ describe 'Branches' do
expect
(
page
).
to
have_content
(
"Protected branches can be managed in project settings"
)
expect
(
page
).
to
have_content
(
"Protected branches can be managed in project settings"
)
end
end
end
end
describe
'Delete protected branch'
do
before
do
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'fix'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'fix'
)
}
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
end
it
'removes branch after modal confirmation'
,
js:
true
do
visit
project_branches_path
(
project
)
fill_in
'branch-search'
,
with:
'fix'
find
(
'#branch-search'
).
native
.
send_keys
(
:enter
)
expect
(
page
).
to
have_content
(
'fix'
)
expect
(
find
(
'.all-branches'
)).
to
have_selector
(
'li'
,
count:
1
)
page
.
find
(
'[data-target="#modal-delete-branch"]'
).
trigger
(
:click
)
expect
(
page
).
to
have_css
(
'.js-delete-branch[disabled]'
)
fill_in
'delete_branch_input'
,
with:
'fix'
click_link
'Delete protected branch'
fill_in
'branch-search'
,
with:
'fix'
find
(
'#branch-search'
).
native
.
send_keys
(
:enter
)
expect
(
page
).
to
have_content
(
'No branches to show'
)
end
end
end
end
context
'logged out'
do
context
'logged out'
do
...
@@ -180,4 +103,13 @@ describe 'Branches' do
...
@@ -180,4 +103,13 @@ describe 'Branches' do
end
end
end
end
end
end
def
sorted_branches
(
repository
,
count
:,
sort_by
:)
sorted_branches
=
repository
.
branches_sorted_by
(
sort_by
).
first
(
count
).
map
do
|
branch
|
Regexp
.
escape
(
branch
.
name
)
end
Regexp
.
new
(
sorted_branches
.
join
(
'.*'
))
end
end
end
spec/features/protected_branches_spec.rb
View file @
51da74b7
require
'spec_helper'
require
'spec_helper'
feature
'Protected Branches'
,
:js
do
feature
'Protected Branches'
,
:js
do
include
ProtectedBranchHelpers
include
EE
::
ProtectedBranchHelpers
let
(
:user
)
{
create
(
:user
,
:admin
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
before
do
context
'logged in as developer'
do
sign_in
(
user
)
before
do
end
project
.
add_developer
(
user
)
sign_in
(
user
)
def
set_protected_branch_name
(
branch_name
)
find
(
".js-protected-branch-select"
).
trigger
(
'click'
)
find
(
".dropdown-input-field"
).
set
(
branch_name
)
click_on
(
"Create wildcard
#{
branch_name
}
"
)
end
describe
"explicit protected branches"
do
it
"allows creating explicit protected branches"
do
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'some-branch'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'some-branch'
)
}
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
expect
(
ProtectedBranch
.
last
.
name
).
to
eq
(
'some-branch'
)
end
end
it
"displays the last commit on the matching branch if it exists"
do
describe
'Delete protected branch'
do
commit
=
create
(
:commit
,
project:
project
)
before
do
project
.
repository
.
add_branch
(
user
,
'some-branch'
,
commit
.
id
)
create
(
:protected_branch
,
project:
project
,
name:
'fix'
)
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
visit
project_protected_branches_path
(
project
)
end
set_protected_branch_name
(
'some-branch'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
commit
.
id
[
0
..
7
])
}
it
'does not allow developer to removes protected branch'
do
end
visit
project_branches_path
(
project
)
it
"displays an error message if the named branch does not exist"
do
fill_in
'branch-search'
,
with:
'fix'
visit
project_protected_branches_path
(
project
)
find
(
'#branch-search'
).
native
.
send_keys
(
:enter
)
set_protected_branch_name
(
'some-branch'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'branch was removed'
)
}
expect
(
page
).
to
have_css
(
'.btn-remove.disabled'
)
end
end
end
end
end
describe
"wildcard protected branches"
do
context
'logged in as master'
do
it
"allows creating protected branches with a wildcard"
do
before
do
visit
project_protected_branches_path
(
project
)
project
.
add_master
(
user
)
set_protected_branch_name
(
'*-stable'
)
sign_in
(
user
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'*-stable'
)
}
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
expect
(
ProtectedBranch
.
last
.
name
).
to
eq
(
'*-stable'
)
end
end
it
"displays the number of matching branches"
do
describe
'Delete protected branch'
do
project
.
repository
.
add_branch
(
user
,
'production-stable'
,
'master'
)
before
do
project
.
repository
.
add_branch
(
user
,
'staging-stable'
,
'master'
)
create
(
:protected_branch
,
project:
project
,
name:
'fix'
)
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
end
visit
project_protected_branches_path
(
project
)
it
'removes branch after modal confirmation'
do
set_protected_branch_name
(
'*-stable'
)
visit
project_branches_path
(
project
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
"2 matching branches"
)
}
fill_in
'branch-search'
,
with:
'fix'
end
find
(
'#branch-search'
).
native
.
send_keys
(
:enter
)
it
"displays all the branches matching the wildcard"
do
expect
(
page
).
to
have_content
(
'fix'
)
project
.
repository
.
add_branch
(
user
,
'production-stable'
,
'master'
)
expect
(
find
(
'.all-branches'
)).
to
have_selector
(
'li'
,
count:
1
)
project
.
repository
.
add_branch
(
user
,
'staging-stable'
,
'master'
)
page
.
find
(
'[data-target="#modal-delete-branch"]'
).
trigger
(
:click
)
project
.
repository
.
add_branch
(
user
,
'development'
,
'master'
)
visit
project_protected_branches_path
(
project
)
expect
(
page
).
to
have_css
(
'.js-delete-branch[disabled]'
)
set_protected_branch_name
(
'*-stable'
)
fill_in
'delete_branch_input'
,
with:
'fix'
set_allowed_to
(
'merge'
)
click_link
'Delete protected branch'
set_allowed_to
(
'push'
)
click_on
"Protect"
visit
project_protected_branches_path
(
project
)
fill_in
'branch-search'
,
with:
'fix'
click_on
"2 matching branches"
find
(
'#branch-search'
).
native
.
send_keys
(
:enter
)
within
(
".protected-branches-list"
)
do
expect
(
page
).
to
have_content
(
'No branches to show'
)
expect
(
page
).
to
have_content
(
"production-stable"
)
expect
(
page
).
to
have_content
(
"staging-stable"
)
expect
(
page
).
not_to
have_content
(
"development"
)
end
end
end
end
end
end
describe
"access control"
do
context
'logged in as admin'
do
describe
'with ref permissions for users enabled'
do
before
do
before
do
sign_in
(
admin
)
stub_licensed_features
(
protected_refs_for_users:
true
)
end
describe
"explicit protected branches"
do
it
"allows creating explicit protected branches"
do
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'some-branch'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'some-branch'
)
}
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
expect
(
ProtectedBranch
.
last
.
name
).
to
eq
(
'some-branch'
)
end
it
"displays the last commit on the matching branch if it exists"
do
commit
=
create
(
:commit
,
project:
project
)
project
.
repository
.
add_branch
(
user
,
'some-branch'
,
commit
.
id
)
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'some-branch'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
commit
.
id
[
0
..
7
])
}
end
end
include_examples
"protected branches > access control > EE"
it
"displays an error message if the named branch does not exist"
do
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'some-branch'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'branch was removed'
)
}
end
end
end
describe
'with ref permissions for users disabled'
do
describe
"wildcard protected branches"
do
before
do
it
"allows creating protected branches with a wildcard"
do
stub_licensed_features
(
protected_refs_for_users:
false
)
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'*-stable'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
'*-stable'
)
}
expect
(
ProtectedBranch
.
count
).
to
eq
(
1
)
expect
(
ProtectedBranch
.
last
.
name
).
to
eq
(
'*-stable'
)
end
end
include_examples
"protected branches > access control > CE"
it
"displays the number of matching branches"
do
project
.
repository
.
add_branch
(
user
,
'production-stable'
,
'master'
)
project
.
repository
.
add_branch
(
user
,
'staging-stable'
,
'master'
)
visit
project_protected_branches_path
(
project
)
set_protected_branch_name
(
'*-stable'
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
context
'with existing access levels'
do
within
(
".protected-branches-list"
)
{
expect
(
page
).
to
have_content
(
"2 matching branches"
)
}
let
(
:protected_branch
)
{
create
(
:protected_branch
,
project:
project
)
}
end
it
"displays all the branches matching the wildcard"
do
project
.
repository
.
add_branch
(
user
,
'production-stable'
,
'master'
)
project
.
repository
.
add_branch
(
user
,
'staging-stable'
,
'master'
)
project
.
repository
.
add_branch
(
user
,
'development'
,
'master'
)
it
'shows users that can push to the branch'
do
visit
project_protected_branches_path
(
project
)
protected_branch
.
push_access_levels
.
new
(
user:
create
(
:user
,
name:
'Jane'
))
set_protected_branch_name
(
'*-stable'
)
.
save!
(
validate:
false
)
set_allowed_to
(
'merge'
)
set_allowed_to
(
'push'
)
click_on
"Protect"
visit
project_settings_repository_path
(
project
)
visit
project_protected_branches_path
(
project
)
click_on
"2 matching branches"
expect
(
page
).
to
have_content
(
"The following user can also push to this branch: "
\
within
(
".protected-branches-list"
)
do
"Jane"
)
expect
(
page
).
to
have_content
(
"production-stable"
)
expect
(
page
).
to
have_content
(
"staging-stable"
)
expect
(
page
).
not_to
have_content
(
"development"
)
end
end
end
end
it
'shows groups that can push to the branch'
do
describe
"access control"
do
protected_branch
.
push_access_levels
.
new
(
group:
create
(
:group
,
name:
'Team Awesome'
))
describe
'with ref permissions for users enabled'
do
.
save!
(
validate:
false
)
before
do
stub_licensed_features
(
protected_refs_for_users:
true
)
end
visit
project_settings_repository_path
(
project
)
include_examples
"protected branches > access control > EE"
end
expect
(
page
).
to
have_content
(
"Members of this group can also push to "
\
describe
'with ref permissions for users disabled'
do
"this branch: Team Awesome"
)
before
do
stub_licensed_features
(
protected_refs_for_users:
false
)
end
end
it
'shows users that can merge into the branch'
do
include_examples
"protected branches > access control > CE"
protected_branch
.
merge_access_levels
.
new
(
user:
create
(
:user
,
name:
'Jane'
))
.
save!
(
validate:
false
)
visit
project_settings_repository_path
(
project
)
context
'with existing access levels'
do
let
(
:protected_branch
)
{
create
(
:protected_branch
,
project:
project
)
}
expect
(
page
).
to
have_content
(
"The following user can also merge into "
\
it
'shows users that can push to the branch'
do
"this branch: Jane"
)
protected_branch
.
push_access_levels
.
new
(
user:
create
(
:user
,
name:
'Jane'
))
end
.
save!
(
validate:
false
)
visit
project_settings_repository_path
(
project
)
expect
(
page
).
to
have_content
(
"The following user can also push to this branch: "
\
"Jane"
)
end
it
'shows groups that have can push to the branch'
do
it
'shows groups that can push to the branch'
do
protected_branch
.
merge_access_levels
.
new
(
group:
create
(
:group
,
name:
'Team Awesome'
))
protected_branch
.
push_access_levels
.
new
(
group:
create
(
:group
,
name:
'Team Awesome'
))
.
save!
(
validate:
false
)
.
save!
(
validate:
false
)
protected_branch
.
merge_access_levels
.
new
(
group:
create
(
:group
,
name:
'Team B'
))
.
save!
(
validate:
false
)
visit
project_settings_repository_path
(
project
)
visit
project_settings_repository_path
(
project
)
expect
(
page
).
to
have_content
(
"Members of these groups can also merge into "
\
expect
(
page
).
to
have_content
(
"Members of this group can also push to "
\
"this branch:"
)
"this branch: Team Awesome"
)
expect
(
page
).
to
have_content
(
/(Team Awesome|Team B) and (Team Awesome|Team B)/
)
end
it
'shows users that can merge into the branch'
do
protected_branch
.
merge_access_levels
.
new
(
user:
create
(
:user
,
name:
'Jane'
))
.
save!
(
validate:
false
)
visit
project_settings_repository_path
(
project
)
expect
(
page
).
to
have_content
(
"The following user can also merge into "
\
"this branch: Jane"
)
end
it
'shows groups that have can push to the branch'
do
protected_branch
.
merge_access_levels
.
new
(
group:
create
(
:group
,
name:
'Team Awesome'
))
.
save!
(
validate:
false
)
protected_branch
.
merge_access_levels
.
new
(
group:
create
(
:group
,
name:
'Team B'
))
.
save!
(
validate:
false
)
visit
project_settings_repository_path
(
project
)
expect
(
page
).
to
have_content
(
"Members of these groups can also merge into "
\
"this branch:"
)
expect
(
page
).
to
have_content
(
/(Team Awesome|Team B) and (Team Awesome|Team B)/
)
end
end
end
end
end
end
end
end
end
def
set_protected_branch_name
(
branch_name
)
find
(
".js-protected-branch-select"
).
trigger
(
'click'
)
find
(
".dropdown-input-field"
).
set
(
branch_name
)
click_on
(
"Create wildcard
#{
branch_name
}
"
)
end
end
end
spec/support/protected_branch_helpers.rb
deleted
100644 → 0
View file @
30818f47
module
ProtectedBranchHelpers
def
set_allowed_to
(
operation
,
option
=
'Masters'
,
form:
'.js-new-protected-branch'
)
within
form
do
find
(
".js-allowed-to-
#{
operation
}
"
).
trigger
(
'click'
)
wait_for_requests
Array
(
option
).
each
{
|
opt
|
click_on
(
opt
)
}
find
(
".js-allowed-to-
#{
operation
}
"
).
trigger
(
'click'
)
# needed to submit form in some cases
end
end
def
set_protected_branch_name
(
branch_name
)
find
(
".js-protected-branch-select"
).
trigger
(
'click'
)
find
(
".dropdown-input-field"
).
set
(
branch_name
)
click_on
(
"Create wildcard
#{
branch_name
}
"
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment