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
53067cd7
Commit
53067cd7
authored
Jul 11, 2017
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show pipeline schedule button for non-member
parent
4daa6da5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
169 additions
and
130 deletions
+169
-130
app/views/projects/pipeline_schedules/index.html.haml
app/views/projects/pipeline_schedules/index.html.haml
+4
-3
changelogs/unreleased/34907-dont-show-pipeline-schedule-button-for-non-member.yml
...907-dont-show-pipeline-schedule-button-for-non-member.yml
+4
-0
spec/features/projects/pipeline_schedules_spec.rb
spec/features/projects/pipeline_schedules_spec.rb
+161
-127
No files found.
app/views/projects/pipeline_schedules/index.html.haml
View file @
53067cd7
...
...
@@ -12,6 +12,7 @@
-
schedule_path_proc
=
->
(
scope
)
{
pipeline_schedules_path
(
@project
,
scope:
scope
)
}
=
render
"tabs"
,
schedule_path_proc:
schedule_path_proc
,
all_schedules:
@all_schedules
,
scope:
@scope
-
if
can?
(
current_user
,
:create_pipeline_schedule
,
@project
)
.nav-controls
=
link_to
new_project_pipeline_schedule_path
(
@project
),
class:
'btn btn-create'
do
%span
=
_
(
'New schedule'
)
...
...
changelogs/unreleased/34907-dont-show-pipeline-schedule-button-for-non-member.yml
0 → 100644
View file @
53067cd7
---
title
:
Do not show pipeline schedule button for non-member
merge_request
:
12757
author
:
Takuya Noguchi
spec/features/projects/pipeline_schedules_spec.rb
View file @
53067cd7
...
...
@@ -9,9 +9,10 @@ feature 'Pipeline Schedules', :feature, js: true do
let
(
:scope
)
{
nil
}
let!
(
:user
)
{
create
(
:user
)
}
context
'logged in as master'
do
before
do
project
.
add_master
(
user
)
sign_in
(
user
)
gitlab_
sign_in
(
user
)
end
describe
'GET /projects/pipeline_schedules'
do
...
...
@@ -194,6 +195,39 @@ feature 'Pipeline Schedules', :feature, js: true do
end
end
end
end
context
'logged in as non-member'
do
before
do
gitlab_sign_in
(
user
)
end
describe
'GET /projects/pipeline_schedules'
do
before
do
visit_pipelines_schedules
end
describe
'The view'
do
it
'does not show create schedule button'
do
expect
(
page
).
not_to
have_link
(
'New schedule'
)
end
end
end
end
context
'not logged in'
do
describe
'GET /projects/pipeline_schedules'
do
before
do
visit_pipelines_schedules
end
describe
'The view'
do
it
'does not show create schedule button'
do
expect
(
page
).
not_to
have_link
(
'New schedule'
)
end
end
end
end
def
visit_new_pipeline_schedule
visit
new_project_pipeline_schedule_path
(
project
,
pipeline_schedule
)
...
...
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