RSpec test refactored