Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-15 21:08:43 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-15 21:08:43 +0300
commit316fbf9f95dcdd16775f0339415572c3195eea92 (patch)
tree40d86a896fc0ff8ce22fbed7e5e3dffc2adceebf /spec/views
parentd9e71b0d412fb9d2d7fc8b00dddac21617eaaf19 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/shared/_label_row.html.haml_spec.rb79
1 files changed, 61 insertions, 18 deletions
diff --git a/spec/views/shared/_label_row.html.haml_spec.rb b/spec/views/shared/_label_row.html.haml_spec.rb
index 1d21574a0c4..e9a0bfdcd4e 100644
--- a/spec/views/shared/_label_row.html.haml_spec.rb
+++ b/spec/views/shared/_label_row.html.haml_spec.rb
@@ -19,23 +19,58 @@ RSpec.describe 'shared/_label_row.html.haml' do
render
end
+ it 'has label title' do
+ expect(rendered).to have_text(label.title)
+ end
+
it 'has a non-linked label title' do
- expect(rendered).not_to have_css('a', text: label.title)
+ expect(rendered).not_to have_link(label.title)
end
- it "has Issues link" do
- expect(rendered).to have_css('a', text: 'Issues')
+ it 'has Issues link' do
+ expect(rendered).to have_link('Issues')
end
- it "has Merge request link" do
- expect(rendered).to have_css('a', text: 'Merge requests')
+ it 'has Merge request link' do
+ expect(rendered).to have_link('Merge requests')
end
- it "shows the path from where the label was created" do
+ it 'shows the path from where the label was created' do
expect(rendered).to have_css('.label-badge', text: project.full_name)
end
end
+ context 'with a subgroup context' do
+ let_it_be(:subgroup) { create(:group, parent: group) }
+ let(:label) { build_stubbed(:group_label, group: subgroup).present(issuable_subject: subgroup) }
+
+ before do
+ assign(:group, label.group)
+
+ render
+ end
+
+ it 'has label title' do
+ expect(rendered).to have_text(label.title)
+ end
+
+ it 'has a non-linked label title' do
+ expect(rendered).not_to have_link(label.title)
+ end
+
+ it 'has Issues link' do
+ expect(rendered).to have_link('Issues')
+ end
+
+ it 'has Merge request link' do
+ expect(rendered).to have_link('Merge requests')
+ end
+
+ it 'shows the path from where the label was created' do
+ expect(rendered).to have_css('.label-badge', text: subgroup.full_name)
+ end
+ end
+
context 'with a group context' do
before do
assign(:group, label.group)
@@ -43,19 +78,23 @@ RSpec.describe 'shared/_label_row.html.haml' do
render
end
+ it 'has label title' do
+ expect(rendered).to have_text(label.title)
+ end
+
it 'has a non-linked label title' do
- expect(rendered).not_to have_css('a', text: label.title)
+ expect(rendered).not_to have_link(label.title)
end
- it "has Issues link" do
- expect(rendered).to have_css('a', text: 'Issues')
+ it 'has Issues link' do
+ expect(rendered).to have_link('Issues')
end
- it "has Merge request link" do
- expect(rendered).to have_css('a', text: 'Merge requests')
+ it 'has Merge request link' do
+ expect(rendered).to have_link('Merge requests')
end
- it "does not show a path from where the label was created" do
+ it 'does not show a path from where the label was created' do
expect(rendered).not_to have_css('.label-badge')
end
end
@@ -65,19 +104,23 @@ RSpec.describe 'shared/_label_row.html.haml' do
render
end
+ it 'has label title' do
+ expect(rendered).to have_text(label.title)
+ end
+
it 'has a non-linked label title' do
- expect(rendered).not_to have_css('a', text: label.title)
+ expect(rendered).not_to have_link(label.title)
end
- it "does not show Issues link" do
- expect(rendered).not_to have_css('a', text: 'Issues')
+ it 'does not show Issues link' do
+ expect(rendered).not_to have_link('Issues')
end
- it "does not show Merge request link" do
- expect(rendered).not_to have_css('a', text: 'Merge requests')
+ it 'does not show Merge request link' do
+ expect(rendered).not_to have_link('Merge requests')
end
- it "does not show a path from where the label was created" do
+ it 'does not show a path from where the label was created' do
expect(rendered).not_to have_css('.label-badge')
end
end