답변

0

사용 webrat와 "have_selector"... 좋은 것 :

response.should have_selector("foo") do |tag| 
    tag.should have_selector("bar", :content => "Hello World") 
end 

이 문제가 자동으로 HTML 태그를 앞에 추가하는 것이 예를 http://www.rubyfocus.biz/blog/2011/01/08/from_have_tag_to_have_selector_in_rspec2_gotchas.html

+0

를 참조하십시오. 그것은 xml로 취급하지 않습니다. 입력을 수정해서는 안됩니다. – MMore

+0

have_selector는 아무 것도 붙이지 않습니다. 테스트 할 때 HTML 버전이 아닌 XML 버전을 실제로 호출해야합니다. – Thilo

+0

적어도 콘텐츠 유형은 application/xml ... – MMore