projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
✨ Use @TemplatePath annotations on most pages
[Sone.git]
/
src
/
test
/
kotlin
/
net
/
pterodactylus
/
sone
/
web
/
pages
/
DeleteAlbumPageTest.kt
diff --git
a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt
b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt
index
a7fd486
..
28f7880
100644
(file)
--- a/
src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt
+++ b/
src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteAlbumPageTest.kt
@@
-6,6
+6,7
@@
import net.pterodactylus.sone.test.getInstance
import net.pterodactylus.sone.test.mock
import net.pterodactylus.sone.test.whenever
import net.pterodactylus.sone.web.baseInjector
import net.pterodactylus.sone.test.mock
import net.pterodactylus.sone.test.whenever
import net.pterodactylus.sone.web.baseInjector
+import net.pterodactylus.sone.web.page.*
import net.pterodactylus.util.web.Method.POST
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.equalTo
import net.pterodactylus.util.web.Method.POST
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.equalTo
@@
-99,7
+100,7
@@
class DeleteAlbumPageTest: WebPageTest(::DeleteAlbumPage) {
fun `album is deleted and page redirects to album if parent album is not root album`() {
setMethod(POST)
whenever(parentAlbum.isRoot).thenReturn(false)
fun `album is deleted and page redirects to album if parent album is not root album`() {
setMethod(POST)
whenever(parentAlbum.isRoot).thenReturn(false)
- whenever(sone.rootAlbum).thenReturn(mock
<Album>
())
+ whenever(sone.rootAlbum).thenReturn(mock())
addAlbum("album-id", album)
addHttpRequestPart("album", "album-id")
verifyRedirect("imageBrowser.html?album=parent-id") {
addAlbum("album-id", album)
addHttpRequestPart("album", "album-id")
verifyRedirect("imageBrowser.html?album=parent-id") {
@@
-112,4
+113,9
@@
class DeleteAlbumPageTest: WebPageTest(::DeleteAlbumPage) {
assertThat(baseInjector.getInstance<DeleteAlbumPage>(), notNullValue())
}
assertThat(baseInjector.getInstance<DeleteAlbumPage>(), notNullValue())
}
+ @Test
+ fun `page is annotated with correct template path`() {
+ assertThat(page.templatePath, equalTo("/templates/deleteAlbum.html"))
+ }
+
}
}