Refatored rspec tests