Ho seguente codice in un'azione:Come verificare il rendering: file => 'public/404.html' in Rspec 2?
render :file => 'public/404.html' and return
Questo funziona bene nel browser. Ho scritto il seguente esempio RSpec per testare questo:
it "renders 404" do
get :new
response.should render_template('public/404.html')
end
Eseguendo questo esempio genera il seguente errore:
Failure/Error: response.should render_template('public/404.html')
Expected block to return true value.
Ho anche provato response.should render_template(:file => 'public/404.html')
Ma anche questo si traduce in un errore.
Come devo verificare questo?
Questo non funziona: render_template (: file => "file fasullo") passaggi. – therin
Funziona per me RSpec 3.2, Rails 4.2 – fny