Commit 668e483f authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch...

Merge branch '12000-push-rules-shows-404-error-when-you-don-t-have-a-license-installed' into 'master'

Hide Push rules link when you don't have a License installed"

Closes #12000

See merge request gitlab-org/gitlab!17530
parents 753eefb0 c254469b
= nav_link(controller: :push_rules) do
= link_to admin_push_rule_path do
.nav-icon-container
= sprite_icon('push-rules')
%span.nav-item-name
= _('Push Rules')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :push_rules, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_push_rule_path do
%strong.fly-out-top-item-name
= _('Push Rules')
- if License.feature_available?(:push_rules)
= nav_link(controller: :push_rules) do
= link_to admin_push_rule_path do
.nav-icon-container
= sprite_icon('push-rules')
%span.nav-item-name
= _('Push Rules')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: :push_rules, html_options: { class: "fly-out-top-item" } ) do
= link_to admin_push_rule_path do
%strong.fly-out-top-item-name
= _('Push Rules')
---
title: Hide Push rules link when you dont have a license installed
merge_request: 17530
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe 'layouts/nav/sidebar/_push_rules_link' do
context 'license includes push rules feature' do
it 'shows the link' do
stub_licensed_features(push_rules: true)
render
expect(rendered).to have_link 'Push Rules'
end
end
context 'license does not include push rules feature' do
it 'hides the link' do
stub_licensed_features(push_rules: false)
render
expect(rendered).not_to have_link 'Push Rules'
end
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