Adding rspec and tests for existing functionality