1
본 사이트에서 정식 링크를 만들지 않았는지 테스트하고 RSpec에서 다음과 같은 Webrat 문제를 겪고 있습니다.RSpec이 헤드 태그를 렌더링하지 않습니다.
여기 테스트입니다 :
[...setup stuff...]
it "should not render a canonical link rel" do
assign(:post, @post)
render
rendered.should have_selector('link', { :rel => 'canonical', :href => post_path(@post, :only_path => false)})
end
그리고 여기 결과 : 당신이 볼 수 있듯이, HTML과 body 태그 사이에 렌더링에는 태그가
Failure/Error: rendered.should have_selector('link', { :rel => 'canonical', :href => post_path(@post, :only_path => false)})
expected following output to contain a <link href='http://test.host/posts/123913-post-name' rel='canonical'/> tag:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body>
<div>
[.... lots more stuff that is rendered properly ....]
없습니다. 그러나, 나는 (서버를 사용하여) 직접 페이지에 액세스 할 때 아무런 문제가 없습니다. 이것은 구성 문제입니까?