Commit c254469b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Hide push rules link if license does not allow it

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 0a62fd23
= 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