Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
rspec1にはマッチャーhave_tagがありましたが、これはrspec2にはもうありません。
RoRコントローラーのXML出力を簡単に確認するにはどうすればよいですか?XPathは素晴らしいでしょう...
次のように、webrat と「have_selector」を使用します。
response.should have_selector("foo") do |tag| tag.should have_selector("bar", :content => "Hello World") end
たとえば、http://www.rubyfocus.biz/blog/2011/01/08/from_have_tag_to_have_selector_in_rspec2_gotchas.htmlを参照してください。