diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/tooling/docs | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) | |
download | gitlab-ce-76a9e64d004e0c02c35b8165ca38d005afb5e823.tar.gz |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/tooling/docs')
-rw-r--r-- | spec/tooling/docs/deprecation_handling_spec.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/tooling/docs/deprecation_handling_spec.rb b/spec/tooling/docs/deprecation_handling_spec.rb new file mode 100644 index 00000000000..e389fe882b2 --- /dev/null +++ b/spec/tooling/docs/deprecation_handling_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require_relative '../../fast_spec_helper' +require_relative '../../../tooling/docs/deprecation_handling' +require_relative '../../support/helpers/next_instance_of' + +RSpec.describe Docs::DeprecationHandling do + include ::NextInstanceOf + + let(:type) { 'deprecation' } + + subject { described_class.new(type).render } + + before do + allow(Rake::FileList).to receive(:new).and_return( + ['14-10-c.yml', '14-2-b.yml', '14-2-a.yml'] + ) + # Create dummy YAML data based on file name + allow(YAML).to receive(:load_file) do |file_name| + { + 'name' => file_name[/[a-z]*\.yml/], + 'announcement_milestone' => file_name[/\d+-\d+/].tr('-', '.') + } + end + end + + it 'sorts entries and milestones' do + allow_next_instance_of(ERB) do |template| + expect(template).to receive(:result_with_hash) do |arguments| + milestones = arguments[:milestones] + entries = arguments[:entries] + + expect(milestones).to eq(['14.2', '14.10']) + expect(entries.map { |e| e['name'] }).to eq(['a.yml', 'b.yml', 'c.yml']) + end + end + + subject + end +end |