diff --git a/tests/api/test_routes.py b/tests/api/test_routes.py index 3d5197d6a..22ef7aea7 100644 --- a/tests/api/test_routes.py +++ b/tests/api/test_routes.py @@ -326,6 +326,44 @@ def test_related_books(self, fixture: RouteTestFixture): ) +class TestSelectedBooksController: + CONTROLLER_NAME = "selected_book_controller" + + @pytest.fixture(scope="function") + def fixture(self, route_test: RouteTestFixture) -> RouteTestFixture: + route_test.set_controller_name(self.CONTROLLER_NAME) + return route_test + + def test_select(self, fixture: RouteTestFixture): + url = "/works///select_book" + fixture.assert_authenticated_request_calls( + url, fixture.controller.select, "", "", None, None # type: ignore[union-attr] + ) + fixture.assert_supported_methods(url, "POST") + + def test_unselect(self, fixture: RouteTestFixture): + url = "/works///unselect_book" + fixture.assert_authenticated_request_calls( + url, fixture.controller.unselect, "", "", None, None # type: ignore[union-attr] + ) + fixture.assert_supported_methods(url, "DELETE") + + def test_detail(self, fixture: RouteTestFixture): + url = "/selected_books//" + fixture.assert_authenticated_request_calls( + url, fixture.controller.detail, "", "", None, None # type: ignore[union-attr] + ) + fixture.assert_supported_methods(url, "GET", "DELETE") + + def test_selected_books(self, fixture: RouteTestFixture): + url = "/selected_books" + fixture.assert_authenticated_request_calls( + url, + fixture.controller.fetch_books, # type: ignore[union-attr] + ) + fixture.assert_supported_methods(url, "GET") + + class TestAnalyticsController: CONTROLLER_NAME = "analytics_controller"