Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rails/dom/testing/assertions/selector_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def determine_root_from(args, previous_selection = nil)
elsif previous_selection
previous_selection
else
document_root_element
nodeset document_root_element
end
end

Expand Down
13 changes: 13 additions & 0 deletions test/selector_assertions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,18 @@ def test_substitution_values
end
end

def test_assert_select_root_html
render_html '<a></a>'

assert_select 'a'
end

def test_assert_select_root_xml
render_xml '<rss version="2.0"></rss>'

assert_select 'rss'
end

def test_nested_assert_select
render_html %Q{<div id="1">foo</div><div id="2">foo</div>}
assert_select "div" do |elements|
Expand Down Expand Up @@ -241,6 +253,7 @@ def test_feed_item_encoded
</channel>
</rss>
EOF

assert_select "channel item description" do

assert_select_encoded do
Expand Down