Archive | May, 2012

Ruby on Rails / RSpec /Capybara

20 May

Trying to debug rspec/capybara I was trying to do:


puts page.body
puts page.html

and was getting a blank page with:

It is because it was Capybara, so you have to use:

puts response.body

Check for undefined/null in Javascript

10 May

Best way is:


if (typeof foo !== "undefined") // Note the quote marks around "undefined"
// the triple equals (===  or !==) does strict type checking