xeqi / kerodon

interaction and testing library for html based ring apps.
305 stars 22 forks source link

`status?` fails because response doesn't contain a :status #22

Closed mathias closed 10 years ago

mathias commented 10 years ago

This isn't technically due to kerodon, but kerodon provides the status? function, so I'm starting here. Looking into this, I realized that the response created by Peridot doesn't have a :status when I try to use just Peridot. Peridot uses ring-mock, and that is what is giving us the response from the app handler. Again, trying to just use ring-mock directly, I see that its response doesn't contain :status or :headers keys.

Has anyone else run into this?

xeqi commented 10 years ago

I suspect the handler is returning a map, but not a complete ring response map. Would you be able to provide more details or a minimal example of your handler?

mathias commented 10 years ago

I was able to get this working when just using ring-mock and midje, so I'll try to write a small demo app handler with one route, and see if I can nail down why I was only seeing a body.

On Sun, Feb 16, 2014 at 9:15 PM, Nelson Morris notifications@github.comwrote:

I suspect the handler is returning a map, but not a complete ring response map. Would you be able to provide more details or a minimal example of your handler?

Reply to this email directly or view it on GitHubhttps://github.com/xeqi/kerodon/issues/22#issuecomment-35225923 .

Matt Gauger http://blog.mattgauger.com

mathias commented 10 years ago

You were right -- there was a random route in my app that wasn't using liberator and it was only giving back a map with a :body key.

Sorry for the extraneous issue. Closing now.