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
17f1854f
Commit
17f1854f
authored
Dec 10, 2019
by
mo khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render html from projects/licenses#index
parent
f6701543
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
ee/app/controllers/projects/licenses_controller.rb
ee/app/controllers/projects/licenses_controller.rb
+3
-0
ee/spec/controllers/projects/licenses_controller_spec.rb
ee/spec/controllers/projects/licenses_controller_spec.rb
+8
-2
No files found.
ee/app/controllers/projects/licenses_controller.rb
View file @
17f1854f
...
...
@@ -7,6 +7,9 @@ module Projects
def
index
respond_to
do
|
format
|
format
.
html
do
render
status: :ok
end
format
.
json
do
::
Gitlab
::
UsageDataCounters
::
LicensesList
.
count
(
:views
)
...
...
ee/spec/controllers/projects/licenses_controller_spec.rb
View file @
17f1854f
...
...
@@ -2,8 +2,8 @@
require
'spec_helper'
describe
Projects
::
Security
::
LicensesController
do
describe
"GET
index.json
"
do
describe
Projects
::
LicensesController
do
describe
"GET
#index
"
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:private
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:params
)
{
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
...
...
@@ -23,6 +23,12 @@ describe Projects::Security::LicensesController do
stub_licensed_features
(
license_management:
true
)
end
it
'responds to an HTML request'
do
get
:index
,
params:
params
expect
(
response
).
to
have_http_status
(
:ok
)
end
it
'counts usage of the feature'
do
expect
(
::
Gitlab
::
UsageDataCounters
::
LicensesList
).
to
receive
(
:count
).
with
(
:views
)
...
...
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