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
4b59a5aa
Commit
4b59a5aa
authored
Sep 16, 2020
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add route `/new` under Test Cases
Adds route `/new` under Test Cases to show create test case form.
parent
99a7757c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
6 deletions
+39
-6
ee/app/controllers/projects/quality/test_cases_controller.rb
ee/app/controllers/projects/quality/test_cases_controller.rb
+10
-0
ee/app/views/projects/quality/test_cases/new.html.haml
ee/app/views/projects/quality/test_cases/new.html.haml
+11
-0
ee/config/routes/project.rb
ee/config/routes/project.rb
+1
-1
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
...ontrollers/projects/quality/test_cases_controller_spec.rb
+17
-5
No files found.
ee/app/controllers/projects/quality/test_cases_controller.rb
View file @
4b59a5aa
# frozen_string_literal: true
class
Projects::Quality::TestCasesController
<
Projects
::
ApplicationController
prepend_before_action
:authenticate_user!
,
only:
[
:new
]
before_action
:check_quality_management_available!
before_action
:authorize_read_issue!
before_action
:verify_test_cases_flag!
before_action
:authorize_create_issue!
,
only:
[
:new
]
before_action
do
push_frontend_feature_flag
(
:quality_test_cases
,
project
)
end
...
...
@@ -14,6 +18,12 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController
end
end
def
new
respond_to
do
|
format
|
format
.
html
end
end
private
def
verify_test_cases_flag!
...
...
ee/app/views/projects/quality/test_cases/new.html.haml
0 → 100644
View file @
4b59a5aa
-
add_to_breadcrumbs
_
(
'Test Cases'
),
project_quality_test_cases_path
(
@project
)
-
breadcrumb_title
_
(
'New'
)
-
page_title
_
(
'New Test Case'
)
#js-create-test-case
{
data:
{
project_full_path:
@project
.
full_path
,
project_test_cases_path:
project_quality_test_cases_path
(
@project
),
description_preview_path:
preview_markdown_path
(
@project
),
description_help_path:
help_page_path
(
'user/markdown'
),
labels_manage_path:
project_labels_path
(
@project
),
labels_fetch_path:
project_labels_path
(
@project
,
format: :json
)
}
}
ee/config/routes/project.rb
View file @
4b59a5aa
...
...
@@ -16,7 +16,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
namespace
:quality
do
resources
:test_cases
,
only:
[
:index
]
resources
:test_cases
,
only:
[
:index
,
:new
]
end
resources
:autocomplete_sources
,
only:
[]
do
...
...
ee/spec/controllers/projects/quality/test_cases_controller_spec.rb
View file @
4b59a5aa
...
...
@@ -6,9 +6,7 @@ RSpec.describe Projects::Quality::TestCasesController do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
subject
{
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
describe
'GET #index'
do
shared_examples_for
'test case action'
do
|
template
|
context
'with authorized user'
do
before
do
project
.
add_developer
(
user
)
...
...
@@ -20,11 +18,11 @@ RSpec.describe Projects::Quality::TestCasesController do
stub_licensed_features
(
quality_management:
true
)
end
it
'renders the
index
template'
do
it
'renders the template'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
:index
)
expect
(
response
).
to
render_template
(
template
)
end
context
'when quality_test_cases flag is disabled'
do
...
...
@@ -80,4 +78,18 @@ RSpec.describe Projects::Quality::TestCasesController do
end
end
end
describe
'GET'
do
describe
'#index'
do
subject
{
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
it_behaves_like
'test case action'
,
:index
end
describe
'#new'
do
subject
{
get
:new
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
it_behaves_like
'test case action'
,
:new
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