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
1ad139e9
Commit
1ad139e9
authored
Feb 26, 2020
by
Doug Stull
Committed by
Jan Provaznik
Feb 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tests for ci config path permission checks
- needed to qualify the spec
parent
77d12c4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
app/serializers/merge_request_widget_entity.rb
app/serializers/merge_request_widget_entity.rb
+1
-2
spec/serializers/merge_request_widget_entity_spec.rb
spec/serializers/merge_request_widget_entity_spec.rb
+12
-2
No files found.
app/serializers/merge_request_widget_entity.rb
View file @
1ad139e9
...
...
@@ -95,8 +95,7 @@ class MergeRequestWidgetEntity < Grape::Entity
merge_request
.
all_pipelines
.
none?
&&
merge_request
.
commits_count
.
positive?
&&
can?
(
current_user
,
:read_build
,
merge_request
.
source_project
)
&&
can?
(
current_user
,
:create_pipeline
,
merge_request
.
source_project
)
&&
can?
(
current_user
,
:push_code
,
merge_request
.
source_project
)
can?
(
current_user
,
:create_pipeline
,
merge_request
.
source_project
)
end
end
...
...
spec/serializers/merge_request_widget_entity_spec.rb
View file @
1ad139e9
...
...
@@ -124,9 +124,19 @@ describe MergeRequestWidgetEntity do
end
end
context
'when feature is disabled'
do
context
'when
build
feature is disabled'
do
before
do
project
.
project_feature
.
update
(
repository_access_level:
ProjectFeature
::
DISABLED
)
project
.
project_feature
.
update
(
builds_access_level:
ProjectFeature
::
DISABLED
)
end
it
'has no path'
do
expect
(
subject
[
:merge_request_add_ci_config_path
]).
to
be_nil
end
end
context
'when creating the pipeline is not allowed'
do
before
do
user
.
state
=
'blocked'
end
it
'has no path'
do
...
...
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