Skip to content

Commit

Permalink
Adding a unit test for whitespace around tags on search
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhaskar Maddala committed Jul 29, 2015
1 parent 1222a35 commit 3300603
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/collins/controllers/FormsSpec.scala
Expand Up @@ -6,19 +6,24 @@ import specification._
import collins.controllers.forms._

class FormsSpec extends mutable.Specification {

"Solr expression format should correctly bind a valid query" in {
val result = SolrExpressionFormat.bind("query", Map("query" -> "tag=TRQ* AND name=SomeThing"))
result must beRight
}

"Solr expression format should return errors on invalid query" in {
val result = SolrExpressionFormat.bind("query", Map("query" -> "!A#!!"))
result must beLeft
}

"Solr expression format must return valid query by interpreting as a tag" in {
val result = SolrExpressionFormat.bind("query", Map("query" -> "TRQ12"))
result must beRight
}

"Solr expression format must return valid query by interpreting as a tag with whitespace" in {
val result = SolrExpressionFormat.bind("query", Map("query" -> " TRQ12 "))
result must beRight
}
}

0 comments on commit 3300603

Please sign in to comment.