Files
purchases-ios/Tests/UnitTests/Networking/Backend/BackendPostAttributionDataTests.swift
T
aboedo d1ddd6bf9c Clean up tests folders (#1402)
* moved test suites to Tests folder

* fixed outdated path

* fixed more outdated paths

* moved TestsPlans to Tests folder

* update path to Constants.swift
2022-03-21 10:26:00 -03:00

43 lines
1.1 KiB
Swift

//
// Copyright RevenueCat Inc. All Rights Reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// BackendPostAttributionDataTests.swift
//
// Created by Nacho Soto on 3/7/22.
import Foundation
import Nimble
import XCTest
@testable import RevenueCat
class BackendPostAttributionDataTests: BaseBackendTests {
override func createClient() -> MockHTTPClient {
super.createClient(#file)
}
func testPostAttributesPutsDataInDataKey() throws {
self.httpClient.mock(
requestPath: .postAttributionData(appUserID: Self.userID),
response: .init(statusCode: .success)
)
let data: [String: AnyObject] = ["a": "b" as NSString, "c": "d" as NSString]
backend.post(attributionData: data,
network: AttributionNetwork.appleSearchAds,
appUserID: Self.userID,
completion: nil)
expect(self.httpClient.calls).toEventually(haveCount(1))
}
}