Commit dd6b4227 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by James Lopez

Hide scoped labels help text without corresponding license

parent e2b21a24
- docs_link = help_page_path('user/project/labels.md', anchor: 'scoped-labels')
- if @label.subject.feature_available?(:scoped_labels)
- docs_link = help_page_path('user/project/labels.md', anchor: 'scoped-labels')
.col-sm-10.offset-sm-2.form-text.text-muted.js-has-scoped-labels.hidden
Using
%code ::
denotes a
%a{ href: docs_link, target: '_blank', rel: 'noopener noreferrer' } scoped label set
.col-sm-10.offset-sm-2.form-text.text-muted.js-use-scoped-labels
Use
%code ::
to create a
%a{ href: docs_link, target: '_blank', rel: 'noopener noreferrer' } scoped label set
(eg.
%code priority::1
)
.col-sm-10.offset-sm-2.form-text.text-muted.js-has-scoped-labels.hidden
Using
%code ::
denotes a
%a{ href: docs_link, target: '_blank', rel: 'noopener noreferrer' } scoped label set
.col-sm-10.offset-sm-2.form-text.text-muted.js-use-scoped-labels
Use
%code ::
to create a
%a{ href: docs_link, target: '_blank', rel: 'noopener noreferrer' } scoped label set
(eg.
%code priority::1
)
---
title: Hide scoped labels help text without corresponding license
merge_request: 10737
author:
type: fixed
# frozen_string_literal: true
require 'spec_helper'
describe 'app/views/shared/labels/_create_label_help_text.html.haml' do
include ApplicationHelper
shared_examples 'scoped labels' do
context 'when license has scoped labels feature' do
before do
stub_licensed_features(scoped_labels: true)
end
it 'displays scoped labels hint' do
render 'shared/labels/create_label_help_text'
expect(rendered).to have_content 'scoped label'
end
end
context 'when license does not have scoped labels feature' do
before do
stub_licensed_features(scoped_labels: false)
end
it 'does not display scoped labels hint' do
render 'shared/labels/create_label_help_text'
expect(rendered).not_to have_content 'scoped label'
end
end
end
context 'for project label' do
before do
project = create(:project)
@label = project.labels.new
end
include_examples 'scoped labels'
end
context 'for group label' do
before do
group = create(:group)
@label = group.labels.new
end
include_examples 'scoped labels'
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