Commit 17f1854f authored by mo khan's avatar mo khan

Render html from projects/licenses#index

parent f6701543
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment