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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
175b7834
Commit
175b7834
authored
Jun 22, 2017
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for MilestonesHelper#milestones_filter_dropdown_path
parent
f0886918
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
spec/helpers/milestones_helper_spec.rb
spec/helpers/milestones_helper_spec.rb
+36
-0
No files found.
spec/helpers/milestones_helper_spec.rb
View file @
175b7834
require
'spec_helper'
require
'spec_helper'
describe
MilestonesHelper
do
describe
MilestonesHelper
do
describe
'#milestones_filter_dropdown_path'
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:project2
)
{
create
(
:empty_project
)
}
let
(
:group
)
{
create
(
:group
)
}
context
'when @project present'
do
it
'returns project milestones JSON URL'
do
assign
(
:project
,
project
)
expect
(
helper
.
milestones_filter_dropdown_path
).
to
eq
(
namespace_project_milestones_path
(
project
.
namespace
,
project
,
:json
))
end
end
context
'when @target_project present'
do
it
'returns targeted project milestones JSON URL'
do
assign
(
:target_project
,
project2
)
expect
(
helper
.
milestones_filter_dropdown_path
).
to
eq
(
namespace_project_milestones_path
(
project2
.
namespace
,
project2
,
:json
))
end
end
context
'when @group present'
do
it
'returns group milestones JSON URL'
do
assign
(
:group
,
group
)
expect
(
helper
.
milestones_filter_dropdown_path
).
to
eq
(
group_milestones_path
(
group
,
:json
))
end
end
context
'when neither of @project/@target_project/@group present'
do
it
'returns dashboard milestones JSON URL'
do
expect
(
helper
.
milestones_filter_dropdown_path
).
to
eq
(
dashboard_milestones_path
(
:json
))
end
end
end
describe
"#milestone_date_range"
do
describe
"#milestone_date_range"
do
def
result_for
(
*
args
)
def
result_for
(
*
args
)
milestone_date_range
(
build
(
:milestone
,
*
args
))
milestone_date_range
(
build
(
:milestone
,
*
args
))
...
...
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