Rspec tests refactoring