add unit test and rspec equivalent