@Test
fun `page returns options for sone if sone is logged in`() {
assertThat(json.get("options").toMap(), allOf(
- hasEntry("ShowNotification/NewSones", "false"),
- hasEntry("ShowNotification/NewPosts", "false"),
- hasEntry("ShowNotification/NewReplies", "false")
+ hasEntry("ShowNotification/NewSones", "true"),
+ hasEntry("ShowNotification/NewPosts", "true"),
+ hasEntry("ShowNotification/NewReplies", "true")
))
}
mock<Notification>().apply { whenever(this.createdTime).thenReturn(2000) },
mock<Notification>().apply { whenever(this.createdTime).thenReturn(1000) }
)
- addNotification(*notifications.toTypedArray())
+ notifications.forEachIndexed { index, notification -> addNotification(notification, "notification$index")}
assertThat(json.get("notificationHash").asInt(), equalTo(notifications.sortedBy { it.createdTime }.hashCode()))
}