Use regex to find URLs

This commit is contained in:
Kirill Kamakin
2022-11-28 21:59:08 +01:00
parent a0a3862df7
commit 0c41aac9b7
2 changed files with 6 additions and 12 deletions

View File

@@ -52,7 +52,7 @@ class ShareRecipeRepoImplTest : BaseUnitTest() {
fun `when url has suffix expect saveRecipeByURL removes it`() = runTest {
subject.saveRecipeByURL("https://www.allrecipes.com/recipe/215447/dads-leftover-turkey-pot-pie/ is my favorite recipe")
val expected = ParseRecipeURLInfo(
url = "https://www.allrecipes.com/recipe/215447/dads-leftover-turkey-pot-pie/",
url = "https://www.allrecipes.com/recipe/215447/dads-leftover-turkey-pot-pie",
includeTags = true
)
coVerify { parseRecipeDataSource.parseRecipeFromURL(eq(expected)) }
@@ -62,7 +62,7 @@ class ShareRecipeRepoImplTest : BaseUnitTest() {
fun `when url has prefix and suffix expect saveRecipeByURL removes them`() = runTest {
subject.saveRecipeByURL("Actually, https://www.allrecipes.com/recipe/215447/dads-leftover-turkey-pot-pie/ is my favorite recipe")
val expected = ParseRecipeURLInfo(
url = "https://www.allrecipes.com/recipe/215447/dads-leftover-turkey-pot-pie/",
url = "https://www.allrecipes.com/recipe/215447/dads-leftover-turkey-pot-pie",
includeTags = true
)
coVerify { parseRecipeDataSource.parseRecipeFromURL(eq(expected)) }