Refactored Rspec tests