Quantcast

Controller Integration tests, XML and Dates

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Controller Integration tests, XML and Dates

Shin Tai
Hi,

I'm not sure why but my Date objects are being formatted differently
in my tests to my browser.

I have a controller that uses a builder to create XML which I write to
a StringWriter and then output using a render(contentType:
"application/xml", text: writer.toString())

In my tests, a println of controller.response.getContentAsString() shows:

<start>Thu Mar 10 09:08:05 GMT 2011</start>

But a GET from my browser shows:

<start>2011-03-02 10:00:00.0</start>

Am I just looking at a difference because of how the
mockHttpServletResponse works? I may just switch to a functional test.

Thanks,
Shin

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Controller Integration tests, XML and Dates

Shin Tai
On 10/03/2011, Shin Tai <[hidden email]> wrote:
> Hi,
>
> I'm not sure why but my Date objects are being formatted differently
> in my tests to my browser.
>

It's ok, panic over.

Setting the format explicitly when I'm building the XML seems to make
it consistent.

Shin

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...