diff options
Diffstat (limited to 'spec/helpers/labels_helper_spec.rb')
-rw-r--r-- | spec/helpers/labels_helper_spec.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb index 58eaf991d6e..314305d7a8e 100644 --- a/spec/helpers/labels_helper_spec.rb +++ b/spec/helpers/labels_helper_spec.rb @@ -6,7 +6,7 @@ describe LabelsHelper do let(:context_project) { project } context "when asking for a #{issuables_type} link" do - subject { show_label_issuables_link?(label, issuables_type, project: context_project) } + subject { show_label_issuables_link?(label.present(issuable_subject: nil), issuables_type, project: context_project) } context "when #{issuables_type} are enabled for the project" do let(:project) { create(:project, "#{issuables_type}_access_level": ProjectFeature::ENABLED) } @@ -279,4 +279,21 @@ describe LabelsHelper do expect(label.color).to eq('bar') end end + + describe '#label_status_tooltip' do + let(:status) { 'unsubscribed'.inquiry } + subject { label_status_tooltip(label.present(issuable_subject: nil), status) } + + context 'with a project label' do + let(:label) { create(:label, title: 'bug') } + + it { is_expected.to eq('Subscribe at project level') } + end + + context 'with a group label' do + let(:label) { create(:group_label, title: 'bug') } + + it { is_expected.to eq('Subscribe at group level') } + end + end end |