Skip to content

Commit

Permalink
Updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vict0rS committed Oct 25, 2017
1 parent 0a363c0 commit f72d5ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Tests/EndpointSpec.swift
Expand Up @@ -162,9 +162,15 @@ final class EndpointSpec: QuickSpec {
expect(issue.title).to(equal(expectedIssue.title))
}

it("updates headers to include Content-Type: application/json") {
let contentTypeHeaders = ["Content-Type": "application/json"]
let initialHeaderFields = endpoint.httpHeaderFields ?? [:]
let expectedHTTPHeaderFields = initialHeaderFields.merging(contentTypeHeaders) { initialValue, _ in initialValue }
expect(request.allHTTPHeaderFields).to(equal(expectedHTTPHeaderFields))
}

it("doesn't update any of the other properties") {
expect(request.url?.absoluteString).to(equal(endpoint.url))
expect(request.allHTTPHeaderFields).to(equal(endpoint.httpHeaderFields))
expect(request.httpMethod).to(equal(endpoint.method.rawValue))
}
}
Expand Down

0 comments on commit f72d5ed

Please sign in to comment.