aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/xyz/driver/core/rest/RestTest.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/xyz/driver/core/rest/RestTest.scala')
-rw-r--r--src/test/scala/xyz/driver/core/rest/RestTest.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/scala/xyz/driver/core/rest/RestTest.scala b/src/test/scala/xyz/driver/core/rest/RestTest.scala
new file mode 100644
index 0000000..2c3fb7f
--- /dev/null
+++ b/src/test/scala/xyz/driver/core/rest/RestTest.scala
@@ -0,0 +1,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)
+ }
+}