Refactored tests to remove rspec depreciation warning