projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
✅ Add more tests for FreenetTemplatePage
[Sone.git]
/
src
/
test
/
kotlin
/
net
/
pterodactylus
/
sone
/
web
/
ajax
/
GetTranslationAjaxPageTest.kt
diff --git
a/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetTranslationAjaxPageTest.kt
b/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetTranslationAjaxPageTest.kt
index
87ea2c6
..
ebf4edd
100644
(file)
--- a/
src/test/kotlin/net/pterodactylus/sone/web/ajax/GetTranslationAjaxPageTest.kt
+++ b/
src/test/kotlin/net/pterodactylus/sone/web/ajax/GetTranslationAjaxPageTest.kt
@@
-1,7
+1,10
@@
package net.pterodactylus.sone.web.ajax
package net.pterodactylus.sone.web.ajax
+import net.pterodactylus.sone.test.getInstance
+import net.pterodactylus.sone.web.baseInjector
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.equalTo
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.equalTo
+import org.hamcrest.Matchers.notNullValue
import org.junit.Test
/**
import org.junit.Test
/**
@@
-13,8
+16,13
@@
class GetTranslationAjaxPageTest : JsonPageTest("getTranslation.ajax", requiresL
fun `translation is returned correctly`() {
addTranslation("foo", "bar")
addRequestParameter("key", "foo")
fun `translation is returned correctly`() {
addTranslation("foo", "bar")
addRequestParameter("key", "foo")
- assertThat
(json.isSuccess, equalTo(true)
)
+ assertThat
JsonIsSuccessful(
)
assertThat(json["value"]?.asText(), equalTo("bar"))
}
assertThat(json["value"]?.asText(), equalTo("bar"))
}
+ @Test
+ fun `page can be created by dependency injection`() {
+ assertThat(baseInjector.getInstance<GetTranslationAjaxPage>(), notNullValue())
+ }
+
}
}