Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I, as a human, view the RSpec rendered views, and if, so how?

I would like to be able see the output from the path requested within one of my view specs. Rspec has access to the rendered view, but I would like access to it myself. Does anyone know how to actually view the rendered views?

like image 313
Rebekah Waterbury Avatar asked May 30 '12 07:05

Rebekah Waterbury


1 Answers

If, like me, you either don't want to use capybara + launchy, or you can't get it to work, you can just do this:

    IO.write('/tmp/test.html', rendered)

... and if you're on a mac:

    `open /tmp/test.html`
like image 166
mpelzsherman Avatar answered Sep 29 '22 13:09

mpelzsherman