He siguiente código en una acción:Cómo probar el procesamiento: file => 'public/404.html' en Rspec 2?
render :file => 'public/404.html' and return
Esto funciona bien en el navegador. He escrito el siguiente ejemplo rspec para probar esto:
it "renders 404" do
get :new
response.should render_template('public/404.html')
end
Al ejecutar este ejemplo produce el siguiente error:
Failure/Error: response.should render_template('public/404.html')
Expected block to return true value.
también he intentado response.should render_template(:file => 'public/404.html')
pero eso también resulta en un error.
¿Cómo debo probar esto?
Esto no funciona: render_template (: file => "archivo falso") pases. – therin
Funciona para mí RSpec 3.2, Rails 4.2 – fny