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
829b2001
Commit
829b2001
authored
Jul 13, 2018
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove flaky and redundant expectations
parent
6717643c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
44 deletions
+3
-44
app/views/projects/protected_branches/_update_protected_branch.html.haml
...cts/protected_branches/_update_protected_branch.html.haml
+1
-1
app/views/projects/protected_branches/shared/_protected_branch.html.haml
...cts/protected_branches/shared/_protected_branch.html.haml
+1
-1
qa/qa/factory/resource/branch.rb
qa/qa/factory/resource/branch.rb
+0
-21
qa/qa/page/project/settings/protected_branches.rb
qa/qa/page/project/settings/protected_branches.rb
+0
-17
qa/qa/specs/features/repository/protected_branches_spec.rb
qa/qa/specs/features/repository/protected_branches_spec.rb
+1
-4
No files found.
app/views/projects/protected_branches/_update_protected_branch.html.haml
View file @
829b2001
...
...
@@ -6,5 +6,5 @@
%td
=
hidden_field_tag
"allowed_to_push_
#{
protected_branch
.
id
}
"
,
protected_branch
.
push_access_levels
.
first
.
access_level
=
dropdown_tag
(
(
protected_branch
.
push_access_levels
.
first
.
humanize
||
'Select'
)
,
options:
{
toggle_class:
'js-allowed-to-push
qa-allowed-to-push
'
,
dropdown_class:
'dropdown-menu-selectable js-allowed-to-push-container capitalize-header'
,
options:
{
toggle_class:
'js-allowed-to-push'
,
dropdown_class:
'dropdown-menu-selectable js-allowed-to-push-container capitalize-header'
,
data:
{
field_name:
"allowed_to_push_
#{
protected_branch
.
id
}
"
,
access_level_id:
protected_branch
.
push_access_levels
.
first
.
id
}})
app/views/projects/protected_branches/shared/_protected_branch.html.haml
View file @
829b2001
...
...
@@ -2,7 +2,7 @@
%tr
.js-protected-branch-edit-form
{
data:
{
url:
namespace_project_protected_branch_path
(
@project
.
namespace
,
@project
,
protected_branch
)
}
}
%td
%span
.ref-name
.qa-protected-branch-name
=
protected_branch
.
name
%span
.ref-name
=
protected_branch
.
name
-
if
@project
.
root_ref?
(
protected_branch
.
name
)
%span
.badge.badge-info.prepend-left-5
default
...
...
qa/qa/factory/resource/branch.rb
View file @
829b2001
...
...
@@ -9,18 +9,6 @@ module QA
project
.
name
=
'protected-branch-project'
end
product
:name
do
Page
::
Project
::
Settings
::
Repository
.
act
do
expand_protected_branches
(
&
:last_branch_name
)
end
end
product
:push_allowance
do
Page
::
Project
::
Settings
::
Repository
.
act
do
expand_protected_branches
(
&
:last_push_allowance
)
end
end
def
initialize
@branch_name
=
'test/branch'
@allow_to_push
=
true
...
...
@@ -80,15 +68,6 @@ module QA
end
page
.
protect_branch
# Avoid Selenium::WebDriver::Error::StaleElementReferenceError
# without sleeping. I.e. this completes fast on fast machines.
page
.
refresh
# It is possible for the protected branch row to "disappear" at first
page
.
wait
do
page
.
has_content?
(
branch_name
)
end
end
end
end
...
...
qa/qa/page/project/settings/protected_branches.rb
View file @
829b2001
...
...
@@ -16,7 +16,6 @@ module QA
end
view
'app/views/projects/protected_branches/_update_protected_branch.html.haml'
do
element
:allowed_to_push
element
:allowed_to_merge
end
...
...
@@ -24,10 +23,6 @@ module QA
element
:protected_branches_list
end
view
'app/views/projects/protected_branches/shared/_protected_branch.html.haml'
do
element
:protected_branch_name
end
def
select_branch
(
branch_name
)
click_element
:protected_branch_select
...
...
@@ -62,18 +57,6 @@ module QA
click_on
'Protect'
end
def
last_branch_name
within_element
(
:protected_branches_list
)
do
all
(
'.qa-protected-branch-name'
).
last
end
end
def
last_push_allowance
within_element
(
:protected_branches_list
)
do
all
(
'.qa-allowed-to-push'
).
last
end
end
private
def
click_allow
(
action
,
text
)
...
...
qa/qa/specs/features/repository/protected_branches_spec.rb
View file @
829b2001
...
...
@@ -21,11 +21,8 @@ module QA
end
context
'when developers and maintainers are allowed to push to a protected branch'
do
let!
(
:protected_branch
)
{
create_protected_branch
(
allow_to_push:
true
)
}
it
'user with push rights successfully pushes to the protected branch'
do
expect
(
protected_branch
.
name
).
to
have_content
(
branch_name
)
expect
(
protected_branch
.
push_allowance
).
to
have_content
(
'Developers + Maintainers'
)
create_protected_branch
(
allow_to_push:
true
)
push
=
push_new_file
(
branch_name
)
...
...
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