}
val fullAccessRequired = "require-full-access" in soneRequest.parameters
val fcpInterfaceActive = "fcp-interface-active" in soneRequest.parameters
+ val strictFiltering = "strict-filtering" in soneRequest.parameters
soneRequest.core.preferences.newRequireFullAccess = fullAccessRequired
soneRequest.core.preferences.newFcpInterfaceActive = fcpInterfaceActive
+ soneRequest.core.preferences.newStrictFiltering = strictFiltering
val postsPerPage = soneRequest.parameters["posts-per-page"]?.toIntOrNull()
val charactersPerPost = soneRequest.parameters["characters-per-post"]?.toIntOrNull()
templateContext["require-full-access"] = preferences.requireFullAccess
templateContext["post-cut-off-length"] = preferences.postCutOffLength
templateContext["posts-per-page"] = preferences.postsPerPage
+ templateContext["strict-filtering"] = preferences.strictFiltering
}
}
core.preferences.newRequireFullAccess = true
core.preferences.newPostCutOffLength = 51
core.preferences.newPostsPerPage = 10
+ core.preferences.newStrictFiltering = true
}
@Before
assertThat(templateContext["require-full-access"], equalTo<Any>(true))
assertThat(templateContext["post-cut-off-length"], equalTo<Any>(51))
assertThat(templateContext["posts-per-page"], equalTo<Any>(10))
+ assertThat(templateContext["strict-filtering"], equalTo<Any>(true))
}
}
}
@Test
+ fun `strict filtering can be set to true`() {
+ verifyThatPreferencesCanBeSet("strict-filtering", "checked", true) { core.preferences.strictFiltering }
+ }
+
+ @Test
+ fun `strict filtering can be set to false`() {
+ verifyThatPreferencesCanBeSet("strict-filtering", null, false) { core.preferences.strictFiltering }
+ }
+
+ @Test
fun `page can be created by dependency injection`() {
assertThat(baseInjector.getInstance<OptionsPage>(), notNullValue())
}