forked from github/wulkanowy-mirror
Fix matching mailboxes when there is more than one space between words (#1964)
This commit is contained in:
parent
83ca9a7060
commit
157becb017
3 changed files with 21 additions and 5 deletions
|
@ -91,6 +91,20 @@ class MailboxRepositoryTest {
|
|||
assertEquals(expectedMailbox, systemUnderTest.getMailbox(student))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `get mailbox for unique non-authorized student but with spaces`() = runTest {
|
||||
val student = getStudentEntity(
|
||||
userName = "Stanisław Kowalski",
|
||||
studentName = "J** K*******",
|
||||
)
|
||||
val expectedMailbox = getMailboxEntity("Jan Kowalski")
|
||||
coEvery { mailboxDao.loadAll(any()) } returns listOf(
|
||||
expectedMailbox,
|
||||
)
|
||||
|
||||
assertEquals(expectedMailbox, systemUnderTest.getMailbox(student))
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException::class)
|
||||
fun `get mailbox for not-unique non-authorized student`() = runTest {
|
||||
val student = getStudentEntity(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue