[Seaside] Failing test for #fromJson:

John McKeon p3anoman at gmail.com
Wed Jun 20 13:24:31 UTC 2012


I'm just guessing, but I bet if you change "Address" to "address" in
the JSON string it just might work.
I'm also posting this to the Magritte list just in case...

Happy Trails
John

On Wed, Jun 20, 2012 at 8:23 AM, Tomas Kukol <tomas.kukol at gmail.com> wrote:

> Hello,
>
> I have created a test for #fromJson: message.
>
> MJTestFromJson >> testFromJsonWithAddress
>       | person address |
>       person := MJTestPerson fromJson:
> '{"Name":"Tomas","Address":{"PostalCode":"19800","City":"Prague"}}'.
>
>       self assert: person name equals:  'Tomas'.
>       address := person address.
>       self assert: address isNil not.
>       self assert: address postalCode equals: '19800'.
>       self assert: address city equals: 'Prague'.
>
> But the test fails because it cannot find PostalCode in MJTestPerson
> instace (should be probably in MJTestAddress). Is it a problem of my
> #fromJson: usage or wrong implementation of JSON deserialization?
>
> Thanks for any information.
>
> Tomas Kukol
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120620/63aa180c/attachment.htm


More information about the seaside mailing list