Created
September 19, 2018 13:57
-
-
Save dylanmaryk/403cbf71e114fb2a560f02dd7d273278 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("route to result card header component view model mapper test") { | |
context("when the route is a walking route") { | |
let route = Route.mockWalkingRoute | |
let departureDate = (route.segments?.first?.stops?.first?.scheduledDate)! | |
context("when the route is in less than 15 minutes") { | |
let currentDate = calendar.date(byAdding: .minute, value: -14, to: departureDate)! | |
let model = mapper.resultCardHeaderComponentViewModel(for: route, currentDate: currentDate) | |
it("returns a route type string for walking") { | |
expect(model.routeType).to(equal("Walk")) | |
} | |
it("returns a departure string for the route") { | |
expect(model.departureTime.string).to(equal("Get going in 14 min")) | |
} | |
it("returns a route duration string for the route") { | |
expect(model.routeDuration).to(equal("42")) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment