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

import org.scalatest.{FlatSpec, Matchers}

import akka.util.ByteString

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)
  }
}