From: David ‘Bombe’ Roden Date: Sun, 27 Nov 2016 01:22:55 +0000 (+0100) Subject: Actually verify that the album is deleted X-Git-Tag: 0.9.7^2~385 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1491b5f7437ef61080d83d323388a547b6dc32c2;p=Sone.git Actually verify that the album is deleted --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/DeleteAlbumPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/DeleteAlbumPageTest.kt index fc69797..d742bb6 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/DeleteAlbumPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/DeleteAlbumPageTest.kt @@ -12,6 +12,7 @@ import org.hamcrest.Matchers.equalTo import org.junit.Before import org.junit.Test import org.mockito.ArgumentMatchers.anyString +import org.mockito.Mockito.verify /** * Unit test for [DeleteAlbumPage]. @@ -86,7 +87,11 @@ class DeleteAlbumPageTest : WebPageTest() { addAlbum("album-id", album) addHttpRequestParameter("album", "album-id") expectedException.expect(redirectsTo("imageBrowser.html?sone=sone-id")) - page.handleRequest(freenetRequest, templateContext) + try { + page.handleRequest(freenetRequest, templateContext) + } finally { + verify(core).deleteAlbum(album) + } } @Test @@ -96,7 +101,11 @@ class DeleteAlbumPageTest : WebPageTest() { addAlbum("album-id", album) addHttpRequestParameter("album", "album-id") expectedException.expect(redirectsTo("imageBrowser.html?album=parent-id")) - page.handleRequest(freenetRequest, templateContext) + try { + page.handleRequest(freenetRequest, templateContext) + } finally { + verify(core).deleteAlbum(album) + } } }