1 package net.pterodactylus.sone.web.ajax
3 import org.hamcrest.MatcherAssert.assertThat
4 import org.hamcrest.Matchers.equalTo
8 * Unit test for [GetTranslationAjaxPage].
10 class GetTranslationAjaxPageTest : JsonPageTest("getTranslation.ajax", requiresLogin = false, needsFormPassword = false, pageSupplier = ::GetTranslationAjaxPage) {
13 fun `translation is returned correctly`() {
14 addTranslation("foo", "bar")
15 addRequestParameter("key", "foo")
16 assertThatJsonIsSuccessful()
17 assertThat(json["value"]?.asText(), equalTo("bar"))