나는 액션 코드를 다음 있습니다 : 이것은 브라우저에서 잘 작동Rspec 2에서 렌더링을 테스트하는 방법 : file => 'public/404.html'?
render :file => 'public/404.html' and return
.
it "renders 404" do
get :new
response.should render_template('public/404.html')
end
다음과 같은 오류이 예의 결과를 실행 : :이 테스트하려면 다음 RSpec에 예를 작성했습니다
Failure/Error: response.should render_template('public/404.html')
Expected block to return true value.
또한 오류가 response.should render_template(:file => 'public/404.html')
하지만 너무 결과를 시도했습니다.
어떻게 테스트해야합니까?
이 작동하지 않습니다 : render_template (: file => "bogus file") 이 통과합니다. – therin
나를 위해 작동합니다 RSpec 3.2, Rails 4.2 – fny