Doing PUT to /expressions/*?format=yaml fails (test case included)

0 views
Skip to first unread message

Gonzalo Suarez

unread,
Jun 24, 2009, 10:45:18 AM6/24/09
to openwferu-users
Hi John,

My co-worker Nando and I are testing thoroughly ruote-rest trunk
version. We've come up with an issue related to expressions and date
formats. We're using ruby 1.8.7 (2008-08-11 patchlevel 72)
[i486-linux] - included with Debian Lenny.

Here is a way to get the bug (web browser):

1. Launch the default process (PUT /processes).
2. GET /expressions for that process and select one of them (i.e. 0_0_0)
3. Update (PUT) that flowexpression (0_0_0) (YAML format)
4. Now again GET /expressions for that process. The error will show as follows:

undefined method `ctime' for "2009-06-08 11:58:40.001874 +02:00":String
ruote-rest/lib/helpers/application.rb:77:in `display_time'

The error is similar when using a REST client with "Accept: application/xml

undefined method `httpdate' for "2009-06-08 11:44:04.057000 +02:00":String
ruote-rest/vendor/ruote/lib/openwfe/util/xml.rb:156:in `to_httpdate'

Interestingly enough, there are no errors from the REST client when
using "Accept: application/json"

For more info, please refer to the attached file.

Best regards,
Gonzalo

st_expressions_yaml.rb

John Mettraux

unread,
Jun 25, 2009, 12:05:46 AM6/25/09
to openwfe...@googlegroups.com
On Wed, Jun 24, 2009 at 11:45 PM, Gonzalo
Suarez<gonzalo....@gmail.com> wrote:
>
> undefined method `ctime' for "2009-06-08 11:58:40.001874 +02:00":String
> ruote-rest/lib/helpers/application.rb:77:in `display_time'
>
> The error is similar when using a REST client with "Accept: application/xml
>
> For more info, please refer to the attached file.

Hello Gonzalo and Nando,

thanks for the detailed report and the test case, very classy !

I have fixed that. I'm not very happy about the fix though, well,
we'll do better with ruote-kit and ruote2.0

http://github.com/jmettraux/ruote/commit/53a147f3f2b3893d555f9b0e579e01bb18053ecc
http://github.com/jmettraux/ruote-rest/commit/4fee6c3ab7d01427f748b9915c4a0814dc78cbe8


Thanks again !

--
John Mettraux - http://jmettraux.wordpress.com

Reply all
Reply to author
Forward
0 new messages