aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/core/rest/RestTest.scala
blob: 2c3fb7f24948f809afdab9e5d8ed2d03df810718 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package xyz.driver.core.rest

import akka.util.ByteString
import org.scalatest.{FlatSpec, Matchers}

class RestTest extends FlatSpec with Matchers {
  "`escapeScriptTags` function" should "escap script tags properly" in {
    val dirtyString = "</sc----</sc----</sc"
    val cleanString = "--------------------"

    (escapeScriptTags(ByteString(dirtyString)).utf8String) should be(dirtyString.replace("</sc", "< /sc"))

    (escapeScriptTags(ByteString(cleanString)).utf8String) should be(cleanString)
  }
}