Skip to content

Commit e02667f

Browse files
Fix coverage
The v1 of bake_order_headers was not completely covered because of how it works.
1 parent ed61f41 commit e02667f

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

spec/kitchen_spec/directions/bake_order_headers_spec.rb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44

55
RSpec.describe Kitchen::Directions::BakeOrderHeaders do
66
let(:page_with_headers) do
7+
book_containing(html:
8+
one_chapter_with_one_page_containing(
9+
<<~HTML
10+
<h3>The top title within the page</h3>
11+
<div>Body of introduction
12+
<h6>Subtitle</h6>
13+
<p>a paragraph</p>
14+
</div>
15+
<h3 data-type="document-title">wow another header</h3>
16+
<h5>subheader also</h5>
17+
<div><h6>subtitle subtitle</h6><p>paragraph</p>
18+
<h6>here we see a subtitle</h6>
19+
</div>
20+
HTML
21+
)
22+
).pages.first
23+
end
24+
25+
let(:page_with_random_headers) do
726
book_containing(html:
827
one_chapter_with_one_page_containing(
928
<<~HTML
@@ -34,7 +53,7 @@
3453
end
3554

3655
it 'works (v2)' do
37-
described_class.v2(within: page_with_headers)
38-
expect(page_with_headers).to match_snapshot_auto
56+
described_class.v2(within: page_with_random_headers)
57+
expect(page_with_random_headers).to match_snapshot_auto
3958
end
4059
end
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
<div data-type="page" id="testidOne">
2-
<h3>The top title within the page</h3>
2+
<h2>The top title within the page</h2>
33
<div>Body of introduction
4-
<h6>Subtitle</h6>
4+
<h4>Subtitle</h4>
55
<p>a paragraph</p>
66
</div>
7-
<h3 data-type="document-title">wow another header</h3>
8-
<h5>subheader also</h5>
9-
<div><h6>subtitle subtitle</h6><p>paragraph</p>
10-
<h6>here we see a subtitle</h6>
7+
<h2 data-type="document-title" data-rex-keep="true">wow another header</h2>
8+
<h3>subheader also</h3>
9+
<div><h4>subtitle subtitle</h4><p>paragraph</p>
10+
<h4>here we see a subtitle</h4>
1111
</div>
12-
<h2>The SS Morro Castle was</h2>
13-
<h3>an inside job</h3>
14-
<h6>(probably)</h6>
15-
<h4>Like, there was a</h4>
16-
<h5>CIA agent on board...</h5>
17-
<h5>I'm just saying</h5>
1812

1913
</div>

0 commit comments

Comments
 (0)