rewrote test into rspec specs