Mock js objects with capybara