summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/reference_parser/base_parser_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
commit0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch)
tree4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/lib/banzai/reference_parser/base_parser_spec.rb
parent744144d28e3e7fddc117924fef88de5d9674fe4c (diff)
downloadgitlab-ce-14.3.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/lib/banzai/reference_parser/base_parser_spec.rb')
-rw-r--r--spec/lib/banzai/reference_parser/base_parser_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/lib/banzai/reference_parser/base_parser_spec.rb b/spec/lib/banzai/reference_parser/base_parser_spec.rb
index 095500cdc53..4701caa0667 100644
--- a/spec/lib/banzai/reference_parser/base_parser_spec.rb
+++ b/spec/lib/banzai/reference_parser/base_parser_spec.rb
@@ -247,15 +247,15 @@ RSpec.describe Banzai::ReferenceParser::BaseParser do
end
end
- it 'returns referenceable and visible objects, alongside nodes that are referenceable but not visible' do
- expect(subject.gather_references(nodes)).to match(
- visible: contain_exactly(6, 8, 10),
- not_visible: match_array(nodes.select { |n| n.id.even? && n.id <= 5 })
- )
+ it 'returns referenceable and visible objects, alongside all and visible nodes' do
+ referenceable = nodes.select { |n| n.id.even? }
+ visible = nodes.select { |n| [6, 8, 10].include?(n.id) }
+
+ expect_gathered_references(subject.gather_references(nodes), [6, 8, 10], referenceable, visible)
end
it 'is always empty if the input is empty' do
- expect(subject.gather_references([])) .to match(visible: be_empty, not_visible: be_empty)
+ expect_gathered_references(subject.gather_references([]), [], [], [])
end
end