Improve capybara specs and define env for rake tasks