【发布时间】:2015-06-05 14:39:03
【问题描述】:
有一个像下面这样的XML,我怎么能assert_select标签atom:link?
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Title</title>
<link>http://example.com</link>
<description>Description</description>
<atom:link href="http://example.com/feed" rel="self" type="application/rss+xml"/>
</channel>
</rss>
assert_select 'title' 工作正常。assert_select 'atom:link' 输出 Expected at least 1 element matching "atom:link", found 0..。
我正在使用 Rails 4.2.0
【问题讨论】:
标签: ruby-on-rails ruby xml ruby-on-rails-4 nokogiri