Refactored some rspec tests