Upgrade rspec and refactor test suite