Skip to content

Commit

Permalink
add nil update tests, fixes #149
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed May 8, 2020
1 parent 19d14a2 commit 046db0f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/FluentBenchmark/Tests/ModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ extension FluentBenchmarker {
return
}

// test find + update with nil value works
guard let found = try Foo.find(foo.id, on: self.database).wait() else {
XCTFail("unexpected nil value")
return
}
try found.update(on: self.database).wait()

let all = try Foo.query(on: self.database)
.filter(\.$bar == nil)
.all().wait()
Expand Down Expand Up @@ -91,6 +98,13 @@ extension FluentBenchmarker {
return
}

// test find + update with nil value works
guard let found = try Foo_2.find(foo.id, on: self.database).wait() else {
XCTFail("unexpected nil value")
return
}
try found.update(on: self.database).wait()

let all = try Foo_2.query(on: self.database)
.filter(\.$bar == nil)
.all().wait()
Expand Down

0 comments on commit 046db0f

Please sign in to comment.