Rails controller test output visualization
I find myself digging into controller tests that I'm not deeply familiar with and just want to get something tactical accomplished. Assuming a Mac, you can put this after a call to a controller method to easily see the resulting html. Often there's enough of a clue in there for me to figure out what other setup or validation the test needs.
File.open('tmp.html', 'w+') {|f| f.write(@response.body)}
system 'open tmp.html'
Written by Greg Vaughn
Related protips
1 Response
Nice, the launchy gem is another great alternative
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#