Skip to content

Commit

Permalink
SPT-1998 fix pr
Browse files Browse the repository at this point in the history
  • Loading branch information
mrandrewsmith committed Apr 16, 2024
1 parent ae09c65 commit 7110bb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NodeKitTests/Infrastructure/Infrastructure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension Routes: UrlRouteProvider {
case .users:
return try? Routes.base + "/users"
case .emptyUsers:
return try? Routes.base + "/userAmptyArr"
return try? Routes.base + "/userEmptyArr"
case .emptyUsersWith204:
return try? Routes.base + "/Get204UserArr"
case .authWithFormUrl:
Expand Down
11 changes: 8 additions & 3 deletions NodeKitTests/Mocks/Network/URLResponsesStub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ enum URLResponsesStub {
switch urlComponents.path.split(separator: "/")[1] {
case "users":
return try makeUsersResponse(request: request)
case "userAmptyArr":
return try makeUserAmptyArrResponse(request: request)
case "userEmptyArr":
return try makeUserEmptyArrResponse(request: request)
case "Get204UserArr":
return try makeGet204UserArrResponse(request: request)
case "authWithFormUrl":
Expand All @@ -46,6 +46,11 @@ enum URLResponsesStub {
static func flush() {
URLProtocolMock.flush()
}
}

// MARK: - Private Methods

private extension URLResponsesStub {

private static func makeUsersResponse(request: URLRequest) throws -> (HTTPURLResponse, Data) {
guard
Expand Down Expand Up @@ -96,7 +101,7 @@ enum URLResponsesStub {
)
}

private static func makeUserAmptyArrResponse(request: URLRequest) throws -> (HTTPURLResponse, Data) {
private static func makeUserEmptyArrResponse(request: URLRequest) throws -> (HTTPURLResponse, Data) {
guard
let url = request.url,
request.httpMethod == Method.get.rawValue,
Expand Down

0 comments on commit 7110bb1

Please sign in to comment.