Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyapuchka committed Dec 22, 2017
1 parent ff44d0a commit e2c7534
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tests/StencilTests/FilterSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ func testFilter() {
let result = try template.render(Context(dictionary: [:]))
try expect(result) == "Hello World"
}

$0.it("checks for underlying nil value correctly") {
let template = Template(templateString: "Hello {{ user.name|default:\"anonymous\" }}")
let result = try template.render(Context(dictionary: ["user": ["name": nil]]))
try expect(result) == "Hello anonymous"
}
}

describe("join filter") {
Expand Down

0 comments on commit e2c7534

Please sign in to comment.