improved rspec tests