Commit fda4e30c authored by Corinna Wiesner's avatar Corinna Wiesner

Change Admin controller CloudLicenses to Licenses

The Admin::CloudLicensesController is renamed to
Admin::SubscriptionsController to make its naming for neutral for the
two use cases of licenses.
parent dd89f16d
......@@ -17,7 +17,7 @@ const apolloProvider = new VueApollo({
});
export default () => {
const el = document.getElementById('js-show-cloud-license-page');
const el = document.getElementById('js-show-subscription-page');
if (!el) {
return null;
......
......@@ -82,7 +82,7 @@ class Admin::LicensesController < Admin::ApplicationController
end
def check_cloud_license
redirect_to admin_cloud_license_path if Gitlab::CurrentSettings.cloud_license_enabled?
redirect_to admin_subscription_path if Gitlab::CurrentSettings.cloud_license_enabled?
end
def license_params
......
# frozen_string_literal: true
class Admin::CloudLicensesController < Admin::ApplicationController
class Admin::SubscriptionsController < Admin::ApplicationController
respond_to :html
feature_category :license
......
......@@ -3,7 +3,7 @@
module Admin
module NavbarHelper
def navbar_controller_path
cloud_license_enabled? ? 'admin/cloud_licenses' : 'admin/licenses'
cloud_license_enabled? ? 'admin/subscriptions' : 'admin/licenses'
end
def navbar_item_name
......@@ -11,7 +11,7 @@ module Admin
end
def navbar_item_path
cloud_license_enabled? ? admin_cloud_license_path : admin_license_path
cloud_license_enabled? ? admin_subscription_path : admin_license_path
end
private
......
- page_title _('Subscription')
#js-show-cloud-license-page{ data: cloud_license_view_data }
#js-show-subscription-page{ data: cloud_license_view_data }
......@@ -33,7 +33,7 @@ namespace :admin do
resource :usage_export, controller: 'licenses/usage_exports', only: [:show]
end
resource :cloud_license, only: [:show]
resource :subscription, only: [:show]
# using `only: []` to keep duplicate routes from being created
resource :application_settings, only: [] do
......
......@@ -103,7 +103,7 @@ RSpec.describe Admin::LicensesController do
get :show
expect(response).to redirect_to(admin_cloud_license_path)
expect(response).to redirect_to(admin_subscription_path)
end
end
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe 'Admin views Cloud License', :js do
RSpec.describe 'Admin views Subscription', :js do
let_it_be(:admin) { create(:admin) }
before do
......@@ -16,7 +16,7 @@ RSpec.describe 'Admin views Cloud License', :js do
context 'with a cloud license only' do
before do
visit(admin_cloud_license_path)
visit(admin_subscription_path)
end
it 'displays the subscription details' do
......@@ -51,7 +51,7 @@ RSpec.describe 'Admin views Cloud License', :js do
let!(:license) { create_current_license(cloud_licensing_enabled: false, plan: License::ULTIMATE_PLAN) }
before do
visit(admin_cloud_license_path)
visit(admin_subscription_path)
end
context 'when removing the a legacy license' do
......@@ -108,7 +108,7 @@ RSpec.describe 'Admin views Cloud License', :js do
before do
allow(License).to receive(:current).and_return(license)
visit(admin_cloud_license_path)
visit(admin_subscription_path)
end
it 'displays a message signaling there is not active subscription' do
......
......@@ -11,7 +11,7 @@ RSpec.describe Admin::NavbarHelper do
end
it 'returns the correct controller path' do
expect(helper.navbar_controller_path).to eq('admin/cloud_licenses')
expect(helper.navbar_controller_path).to eq('admin/subscriptions')
end
it 'returns the correct navbar item name' do
......@@ -19,7 +19,7 @@ RSpec.describe Admin::NavbarHelper do
end
it 'returns the correct navbar item path' do
expect(helper.navbar_item_path).to eq(admin_cloud_license_path)
expect(helper.navbar_item_path).to eq(admin_subscription_path)
end
end
......
......@@ -2,10 +2,10 @@
require 'spec_helper'
RSpec.describe Admin::CloudLicensesController, :cloud_licenses do
RSpec.describe Admin::SubscriptionsController, :cloud_licenses do
include AdminModeHelper
describe 'GET /cloud_licenses' do
describe 'GET /subscriptions' do
context 'when the user is not admin' do
let_it_be(:user) { create(:user) }
......@@ -47,13 +47,13 @@ RSpec.describe Admin::CloudLicensesController, :cloud_licenses do
send_request
expect(response).to render_template(:show)
expect(response.body).to include('js-show-cloud-license-page')
expect(response.body).to include('js-show-subscription-page')
end
end
end
end
def send_request
get admin_cloud_license_path
get admin_subscription_path
end
end
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