refactoring with rspec/capybara tests