refactoring rspec and attribute_enums method