From 551bd2deb21f57e71c052a0c242e1895761b80e7 Mon Sep 17 00:00:00 2001 From: "Sven A. Schmidt" Date: Mon, 20 Jan 2025 14:10:01 +0100 Subject: [PATCH] Add test_not_found --- Tests/AppTests/CustomCollectionControllerTests.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tests/AppTests/CustomCollectionControllerTests.swift b/Tests/AppTests/CustomCollectionControllerTests.swift index 77dee0984..dc5c1b02f 100644 --- a/Tests/AppTests/CustomCollectionControllerTests.swift +++ b/Tests/AppTests/CustomCollectionControllerTests.swift @@ -102,7 +102,7 @@ class CustomCollectionControllerTests: AppTestCase { url: "https://github.com/foo/bar/list.json", packages: [( id: .id0, url: "https://github.com/foo/1", owner: "foo", name: "1" )] ) - + // MUT try await app.test(.GET, "/collections/list") { req async in // validate @@ -111,6 +111,16 @@ class CustomCollectionControllerTests: AppTestCase { } } + func test_not_found() throws { + try withDependencies { + $0.environment.dbId = { nil } + } operation: { + try app.test(.GET, "/collections/list") { + XCTAssertEqual($0.status, .notFound) + } + } + } + }