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
e315bf2e
Commit
e315bf2e
authored
Jul 29, 2020
by
Coung Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve project iterations tests
Improve tests as a result of reviewer feedback
parent
0541f67a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
ee/app/views/layouts/nav/sidebar/_project_iterations_link.html.haml
...ws/layouts/nav/sidebar/_project_iterations_link.html.haml
+1
-0
ee/spec/controllers/projects/iterations_controller_spec.rb
ee/spec/controllers/projects/iterations_controller_spec.rb
+45
-0
No files found.
ee/app/views/layouts/nav/sidebar/_project_iterations_link.html.haml
View file @
e315bf2e
-
return
unless
Feature
.
enabled?
(
:project_iterations
,
@project
.
group
,
default_enabled:
false
)
-
return
unless
Feature
.
enabled?
(
:project_iterations
,
@project
.
group
,
default_enabled:
false
)
-
return
unless
@project
.
feature_available?
(
:iterations
)
-
return
unless
can?
(
current_user
,
:read_iteration
,
@project
)
-
return
unless
can?
(
current_user
,
:read_iteration
,
@project
)
=
nav_link
(
controller: :iterations
)
do
=
nav_link
(
controller: :iterations
)
do
...
...
ee/spec/controllers/projects/iterations_controller_spec.rb
0 → 100644
View file @
e315bf2e
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
IterationsController
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
context
'index'
do
context
'when iterations license is not available'
do
before
do
stub_licensed_features
(
iterations:
false
)
sign_in
(
user
)
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
end
it
'renders 404'
do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when user is unauthorized'
do
before
do
sign_in
(
user
)
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
end
it
'renders 404'
do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
context
'when user is authorized'
do
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
end
it
'renders index successfully'
do
expect
(
response
).
to
be_successful
end
end
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