diff options
-rw-r--r-- | .nvmrc | 2 | ||||
-rw-r--r-- | .tool-versions | 2 | ||||
-rw-r--r-- | content/_data/navigation.yaml | 6 | ||||
-rw-r--r-- | lib/helpers/generic.rb | 2 | ||||
-rw-r--r-- | spec/lib/helpers/generic_spec.rb | 38 |
5 files changed, 32 insertions, 18 deletions
@@ -1 +1 @@ -18.16.1 +18.17.0 diff --git a/.tool-versions b/.tool-versions index d44ce533..e6a5fde9 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ ruby 3.2.2 -nodejs 18.16.1 +nodejs 18.17.0 shellcheck 0.9.0 yarn 1.22.19 diff --git a/content/_data/navigation.yaml b/content/_data/navigation.yaml index a13c39dd..7d03e3c3 100644 --- a/content/_data/navigation.yaml +++ b/content/_data/navigation.yaml @@ -425,10 +425,10 @@ sections: doc_url: 'ee/update/plan_your_upgrade.html' - doc_title: Background migrations doc_url: 'ee/update/background_migrations.html' - - doc_title: Upgrade Omnibus instance + - doc_title: Upgrade a Linux package instance doc_url: 'ee/update/package/' docs: - - doc_title: Convert to Omnibus + - doc_title: Convert to Linux package (Omnibus) doc_url: 'omnibus/update/convert_to_omnibus.html' - doc_title: Convert to Enterprise Edition doc_url: 'ee/update/package/convert_to_ee.html' @@ -450,7 +450,7 @@ sections: doc_url: 'omnibus/update/gitlab_10_changes.html' - doc_title: Downgrade doc_url: 'ee/update/package/downgrade.html' - - doc_title: Upgrade source instance + - doc_title: Upgrade a self-compiled instance doc_url: 'ee/update/upgrading_from_source.html' docs: - doc_title: Patch versions diff --git a/lib/helpers/generic.rb b/lib/helpers/generic.rb index afc39811..7feb7ec0 100644 --- a/lib/helpers/generic.rb +++ b/lib/helpers/generic.rb @@ -195,7 +195,7 @@ module Nanoc::Helpers def docs_breadcrumb_list(path) data = get_nav_sections list = breadcrumb_trail(data, path[1..]) - list.map { |item| item[:name] }.join(", ") + list.map { |item| item[:name] }.join(" › ") end end end diff --git a/spec/lib/helpers/generic_spec.rb b/spec/lib/helpers/generic_spec.rb index 6fa9d4fb..f8b4436a 100644 --- a/spec/lib/helpers/generic_spec.rb +++ b/spec/lib/helpers/generic_spec.rb @@ -12,17 +12,17 @@ RSpec.describe Nanoc::Helpers::Generic do item.new(path) end + before do + mock_items = { '/_data/navigation.yaml' => YAML.load_file('spec/lib/fixtures/navigation-mock.yaml', symbolize_names: true) } + mock_sections = mock_items['/_data/navigation.yaml'][:sections] + allow(mock_class).to receive(:get_nav_sections).and_return(mock_sections) + end + describe '#docs_section' do using RSpec::Parameterized::TableSyntax subject { mock_class.docs_section(mock_item.path.to_s) } - before do - mock_items = { '/_data/navigation.yaml' => YAML.load_file('spec/lib/fixtures/navigation-mock.yaml', symbolize_names: true) } - mock_sections = mock_items['/_data/navigation.yaml'][:sections] - allow(mock_class).to receive(:get_nav_sections).and_return(mock_sections) - end - where(:path, :expected_section_title) do "/ee/tutorials/" | "Learn GitLab with tutorials" "/ee/topics/set_up_organization.html" | "Use GitLab" @@ -39,12 +39,6 @@ RSpec.describe Nanoc::Helpers::Generic do end describe '#build_breadcrumb_list' do - before do - mock_items = { '/_data/navigation.yaml' => YAML.load_file('spec/lib/fixtures/navigation-mock.yaml', symbolize_names: true) } - mock_sections = mock_items['/_data/navigation.yaml'][:sections] - allow(mock_class).to receive(:get_nav_sections).and_return(mock_sections) - end - # Test all six levels of the menu let(:test_data) do [ @@ -214,4 +208,24 @@ RSpec.describe Nanoc::Helpers::Generic do end end end + + describe '#docs_breadcrumb_list' do + using RSpec::Parameterized::TableSyntax + + subject { mock_class.docs_breadcrumb_list(mock_item.path.to_s) } + + where(:path, :expected_breadcrumb_list) do + "/ee/tutorials/" | "Learn GitLab with tutorials" + "/ee/topics/set_up_organization.html" | "Use GitLab › Set up your organization" + "/ee/user/project/autocomplete_characters.html" | "Use GitLab › Plan and track work › Quick actions › Autocomplete characters" + "/ee/user/project/settings/import_export_troubleshooting.html" | "Use GitLab › Organize work with projects › Migrate projects using file exports › Troubleshooting" + "/updog.html" | "" + end + + with_them do + it "returns the breadcrumb trail for the given path" do + expect(subject).to eq(expected_breadcrumb_list) + end + end + end end |