fixed formats

This commit is contained in:
Tony Tam 2012-12-03 13:52:25 -08:00
parent 8b5e638409
commit 61a9cc6e6a

View File

@ -39,7 +39,7 @@ class ModelRefSerializationTest extends FlatSpec with ShouldMatchers {
@RunWith(classOf[JUnitRunner]) @RunWith(classOf[JUnitRunner])
class ModelPropertySerializationTest extends FlatSpec with ShouldMatchers { class ModelPropertySerializationTest extends FlatSpec with ShouldMatchers {
implicit val formats = DefaultFormats + new AllowableValuesSerializer + new ModelPropertySerializer implicit val formats = DefaultFormats + new AllowableValuesSerializer + new ModelPropertySerializer + new ModelRefSerializer
it should "deserialize a model property with allowable values and ref" in { it should "deserialize a model property with allowable values and ref" in {
val jsonString = """ val jsonString = """
@ -68,7 +68,7 @@ class ModelPropertySerializationTest extends FlatSpec with ShouldMatchers {
case _ => fail("expected allowable values") case _ => fail("expected allowable values")
} }
p.items match { p.items match {
case e: ModelRef => { case Some(e: ModelRef) => {
e.ref should be ("Foo") e.ref should be ("Foo")
e.`type` should be ("Bar") e.`type` should be ("Bar")
} }