mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
* moved test suites to Tests folder * fixed outdated path * fixed more outdated paths * moved TestsPlans to Tests folder * update path to Constants.swift
43 lines
1.1 KiB
Swift
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))
|
|
}
|
|
|
|
}
|