Skip to content

Commit 6d01e92

Browse files
author
Marco Bomfim
committed
Adds unit test for video on page
1 parent 5321c0d commit 6d01e92

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed
304 KB
Binary file not shown.

spec/usage/components/video_spec.rb

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,15 @@
44
describe 'Video Component', type: :feature, js: true do
55

66
it 'Renders a video tag on the page' do
7-
#
8-
# class ExamplePage < Matestack::Ui::Page
9-
# def response
10-
# components {
11-
# # simple video
12-
# # test below fails, either add something to `spec/dummy/app/assets/videos/*` or stub it
13-
# # video path: 'yourvid.mp4', width: 500, height: 300
14-
# }
15-
# end
16-
# end
17-
#
18-
# visit '/example'
19-
#
20-
# static_output = page.html
21-
#
22-
# expected_static_output = <<~HTML
23-
# <video src="yourvid.mp4" width="500" height="300"></video>
24-
# HTML
25-
#
26-
# expect(stripped(static_output)).to include(stripped(expected_static_output))
7+
class ExamplePage < Matestack::Ui::Page
8+
def response
9+
components {
10+
video path: 'corgi.mp4', width: 500, height: 300
11+
}
12+
end
13+
end
14+
15+
visit '/example'
16+
expect(page).to have_xpath("//video[contains(@src,'corgi.mp4') and @width='500' and @height='300']")
2717
end
2818
end

0 commit comments

Comments
 (0)