def httparty_response(response_data, code = 200) allow(response_data).to receive(:code).and_return code allow(response_data).to receive(:parsed_response).and_return response_data response_data end