Skip to content

Commit 49306ee

Browse files
Fix map spec & remove p in test output
1 parent 1d0885e commit 49306ee

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

spec/usage/components/map_spec.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def response
1212

1313
map name: 'newmap' do
1414
area shape: 'rect', coords: [0,0,100,100], href: 'first.htm', alt: 'First'
15-
area shape: 'rect', coords: [0,0,100,100], href: 'second.htm', alt: 'Second'
16-
area shape: 'rect', coords: [0,0,100,100], href: 'third.htm', alt: 'Third'
15+
area shape: 'rect', coords: [100,100,200,200], href: 'second.htm', alt: 'Second'
16+
area shape: 'rect', coords: [200,200,300,300], href: 'third.htm', alt: 'Third'
1717
end
1818
}
1919
end
@@ -24,15 +24,14 @@ def response
2424
static_output = page.html
2525

2626
expected_static_output = <<~HTML
27-
<img src="matestack-logo.png" alt="otherlogo" width="500" height="300" usemap="#newmap">
28-
2927
<map name="newmap">
30-
<area shape="rect" coords="0,0,100,100" href="first.htm" alt="First">
31-
<area shape="rect" coords="100,100,200,200" href="second.htm" alt="Second">
32-
<area shape="rect" coords="200,200,300,300" href="third.htm" alt="Third">
28+
<area alt="First" coords="0,0,100,100" href="first.htm" shape="rect">
29+
<area alt="Second" coords="100,100,200,200" href="second.htm" shape="rect">
30+
<area alt="Third" coords="200,200,300,300" href="third.htm" shape="rect">
3331
</map>
3432
HTML
3533

3634
expect(stripped(static_output)).to include(stripped(expected_static_output))
35+
expect(page).to have_xpath("//img[contains(@src,'matestack-logo') and @alt='otherlogo' and @width='500' and @height='300' and @usemap='\#newmap']")
3736
end
3837
end

spec/usage/components/pre_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def response
2020
expected_static_output = <<~HTML
2121
<pre>This is preformatted text</pre>
2222
HTML
23-
p stripped(static_output)
23+
2424
expect(stripped(static_output)).to include(stripped(expected_static_output))
2525
end
2626

0 commit comments

Comments
 (0)