Skip to content

Commit 0867ced

Browse files
Rafael Mendonça Françakaspth
authored andcommitted
Add some failing test when asserting body class
1 parent b320028 commit 0867ced

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/selector_assertions_test.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,20 @@ def test_feed_item_encoded
280280
end
281281

282282
def test_body_not_present_in_empty_document
283-
render_html ''
283+
render_html '<div></div>'
284284
assert_select 'body', 0
285285
end
286286

287+
def test_body_class_can_be_tested
288+
render_html '<body class="foo"></body>'
289+
assert_select '.foo'
290+
end
291+
292+
def test_body_class_can_be_tested_with_html
293+
render_html '<html><body class="foo"><div></div></body></html>'
294+
assert_select '.foo'
295+
end
296+
287297
def document_root_element
288298
@html_document
289299
end

0 commit comments

Comments
 (0)