reimplement tests with rspec