diff options
author | Tanya Pazitny <tpazitny@gitlab.com> | 2019-04-18 15:51:56 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2019-04-18 15:51:56 +0000 |
commit | db00c6c6d89135583bad1ce44fa30fa7ee7b14b1 (patch) | |
tree | 2ee5f3e4b436e6842a358e32ecfb181f7a771bb5 /spec/views | |
parent | f1b3db3cf237daf8da481b594afeca9bc2df276f (diff) | |
download | gitlab-ce-db00c6c6d89135583bad1ce44fa30fa7ee7b14b1.tar.gz |
Fix link issues with labels
* On the project labels page, the label itself should not be clickable.
* On the group labels page, the links for Issues and Merge Requests should be shown.
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/shared/_label_row.html.haml.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/views/shared/_label_row.html.haml.rb b/spec/views/shared/_label_row.html.haml.rb new file mode 100644 index 00000000000..a58d5efc1e3 --- /dev/null +++ b/spec/views/shared/_label_row.html.haml.rb @@ -0,0 +1,32 @@ +require 'spec_helper' + +describe 'shared/_label_row.html.haml' do + label_types = { + 'project label': :label, + 'group label': :group_label + } + + label_types.each do |label_type, label_factory| + let!(:label) { create(label_factory) } + + context "for a #{label_type}" do + it 'has a non-linked label title' do + render 'shared/label_row', label: label + + expect(rendered).not_to have_css('a', text: label.title) + end + + it "has Issues link for #{label_type}" do + render 'shared/label_row', label: label + + expect(rendered).to have_css('a', text: 'Issues') + end + + it "has Merge request link for #{label_type}" do + render 'shared/label_row', label: label + + expect(rendered).to have_css('a', text: 'Merge requests') + end + end + end +end |