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
bbd2ce88
Commit
bbd2ce88
authored
Jul 13, 2020
by
Axel García
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add backend tests for #new epic page
parent
3375aefb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
ee/spec/controllers/groups/epics_controller_spec.rb
ee/spec/controllers/groups/epics_controller_spec.rb
+23
-0
ee/spec/helpers/epics_helper_spec.rb
ee/spec/helpers/epics_helper_spec.rb
+17
-0
No files found.
ee/spec/controllers/groups/epics_controller_spec.rb
View file @
bbd2ce88
...
...
@@ -27,6 +27,12 @@ RSpec.describe Groups::EpicsController do
it_behaves_like
'404 status'
end
describe
'GET #new'
do
subject
{
get
:new
,
params:
{
group_id:
group
}
}
it_behaves_like
'404 status'
end
describe
'GET #show'
do
subject
{
get
:show
,
params:
{
group_id:
group
,
id:
epic
.
to_param
}
}
...
...
@@ -248,6 +254,23 @@ RSpec.describe Groups::EpicsController do
end
end
describe
'GET #new'
do
it
'renders template'
do
group
.
add_developer
(
user
)
get
:new
,
params:
{
group_id:
group
}
expect
(
response
).
to
render_template
'groups/epics/new'
end
context
'with unauthorized user'
do
it
'returns a not found 404 response'
do
get
:new
,
params:
{
group_id:
group
}
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
describe
'GET #show'
do
def
show_epic
(
format
=
:html
)
get
:show
,
params:
{
group_id:
group
,
id:
epic
.
to_param
},
format:
format
...
...
ee/spec/helpers/epics_helper_spec.rb
View file @
bbd2ce88
...
...
@@ -5,6 +5,23 @@ require 'spec_helper'
RSpec
.
describe
EpicsHelper
,
type: :helper
do
include
ApplicationHelper
describe
'#epic_new_app_data'
do
let
(
:group
)
{
create
(
:group
)
}
it
'returns the correct data for a new epic'
do
expected_data
=
{
group_path:
group
.
full_path
,
group_epics_path:
"/groups/
#{
group
.
full_path
}
/-/epics"
,
labels_fetch_path:
"/groups/
#{
group
.
full_path
}
/-/labels.json?include_ancestor_groups=true&only_group_labels=true"
,
labels_manage_path:
"/groups/
#{
group
.
full_path
}
/-/labels"
,
markdown_preview_path:
"/groups/
#{
group
.
full_path
}
/preview_markdown"
,
markdown_docs_path:
help_page_path
(
'user/markdown'
)
}
expect
(
helper
.
epic_new_app_data
(
group
)).
to
match
(
hash_including
(
expected_data
))
end
end
describe
'#epic_endpoint_query_params'
do
let
(
:endpoint_data
)
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