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

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorEvan Read <eread@gitlab.com>2020-11-18 03:29:05 +0300
committerEvan Read <eread@gitlab.com>2020-11-18 05:16:50 +0300
commitabe28229d9978be6012568850157bea013b527b4 (patch)
tree6cd702f57edf99aa6114b3382710996c21981981 /spec
parent9a85f2ea8c75882b90d07f89b89a99a7e13b652f (diff)
Fix more Rubocop issues
Diffstat (limited to 'spec')
-rw-r--r--spec/gitlab/navigation/category_spec.rb4
-rw-r--r--spec/gitlab/navigation/doc_spec.rb2
-rw-r--r--spec/gitlab/navigation/section_spec.rb4
-rw-r--r--spec/gitlab/navigation_spec.rb5
4 files changed, 13 insertions, 2 deletions
diff --git a/spec/gitlab/navigation/category_spec.rb b/spec/gitlab/navigation/category_spec.rb
index 67d28482..63421946 100644
--- a/spec/gitlab/navigation/category_spec.rb
+++ b/spec/gitlab/navigation/category_spec.rb
@@ -4,6 +4,7 @@ require 'gitlab/navigation/doc'
describe Gitlab::Navigation::Category do
subject(:category) { described_class.new(element) }
+
let(:element) do
{
category_title: title,
@@ -14,12 +15,13 @@ describe Gitlab::Navigation::Category do
docs: docs
}
end
+
let(:title) { 'Title' }
let(:external_url) { 'http://example.com' }
let(:url) { 'README.html' }
let(:ee_only) { true }
let(:ee_tier) { 'GitLab Premium' }
- let(:docs) { [ { doc_title: 'Doc Title' } ] }
+ let(:docs) { [{ doc_title: 'Doc Title' }] }
describe '#title' do
subject { category.title }
diff --git a/spec/gitlab/navigation/doc_spec.rb b/spec/gitlab/navigation/doc_spec.rb
index f823a73b..08581b45 100644
--- a/spec/gitlab/navigation/doc_spec.rb
+++ b/spec/gitlab/navigation/doc_spec.rb
@@ -3,6 +3,7 @@ require 'gitlab/navigation/doc'
describe Gitlab::Navigation::Doc do
subject(:doc) { described_class.new(element) }
+
let(:element) do
{
doc_title: title,
@@ -12,6 +13,7 @@ describe Gitlab::Navigation::Doc do
ee_tier: ee_tier
}
end
+
let(:title) { 'Title' }
let(:external_url) { 'http://example.com' }
let(:url) { 'README.html' }
diff --git a/spec/gitlab/navigation/section_spec.rb b/spec/gitlab/navigation/section_spec.rb
index 328793e9..306e4bdd 100644
--- a/spec/gitlab/navigation/section_spec.rb
+++ b/spec/gitlab/navigation/section_spec.rb
@@ -4,6 +4,7 @@ require 'gitlab/navigation/category'
describe Gitlab::Navigation::Section do
subject(:section) { described_class.new(element) }
+
let(:element) do
{
section_title: title,
@@ -13,11 +14,12 @@ describe Gitlab::Navigation::Section do
section_categories: categories
}
end
+
let(:title) { 'Title' }
let(:url) { 'README.html' }
let(:ee_only) { true }
let(:ee_tier) { 'GitLab Premium' }
- let(:categories) { [ { category_title: 'Category Title' } ] }
+ let(:categories) { [{ category_title: 'Category Title' }] }
describe '#title' do
subject { section.title }
diff --git a/spec/gitlab/navigation_spec.rb b/spec/gitlab/navigation_spec.rb
index 659ca3b4..cf092e37 100644
--- a/spec/gitlab/navigation_spec.rb
+++ b/spec/gitlab/navigation_spec.rb
@@ -5,6 +5,7 @@ require 'gitlab/navigation/section'
describe Gitlab::Navigation do
subject(:navigation) { described_class.new(items, item) }
+
let(:item) { double(path: '/omnibus/user/README.html', identifier: double(to_s: '/omnibus/user/README.md')) }
let(:items) do
{
@@ -37,6 +38,7 @@ describe Gitlab::Navigation do
describe '#element_href' do
subject { navigation.element_href(element) }
+
let(:element) { Gitlab::Navigation::Section.new(section_url: url) }
let(:url) { 'user/README.html' }
@@ -51,6 +53,7 @@ describe Gitlab::Navigation do
describe '#show_element?' do
subject { navigation.show_element?(element) }
+
let(:element) { Gitlab::Navigation::Section.new(section_url: url) }
let(:url) { 'user/README.html' }
@@ -65,6 +68,7 @@ describe Gitlab::Navigation do
describe '#id_for' do
subject { navigation.id_for(element) }
+
let(:element) { Gitlab::Navigation::Section.new(section_title: 'Section Example') }
it { is_expected.to eq 'SectionExample' }
@@ -72,6 +76,7 @@ describe Gitlab::Navigation do
describe '#optional_ee_badge' do
subject { navigation.optional_ee_badge(element) }
+
let(:element) { Gitlab::Navigation::Section.new(ee_only: ee_only, ee_tier: ee_tier) }
let(:ee_tier) { 'GitLab Starter' }
let(:ee_only) { true }