xeqi / kerodon

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

Fix build-url function #45

Closed ayato-p closed 8 years ago

ayato-p commented 8 years ago

I just fixed broken function build-url.

Now, almost same as peridot.request/url (difference is just key of args). https://github.com/xeqi/peridot/blob/master/src/peridot/request.clj#L68-L77

glenjamin commented 8 years ago

Could you include a test case which shows why this is needed please?

ayato-p commented 8 years ago

Thanks, I will try it.

ayato-p commented 8 years ago

I just add one example test case. Please check it out. Thank you.

glenjamin commented 8 years ago

Does that test fail without the changes to the code you made? I'm sorry - I'm not quite following what the original issue is.

ayato-p commented 8 years ago

Does that test fail without the changes to the code you made?

Yes.

Sorry, I will explain original issue. When URL include query parameters (like http://example.com/post?foo=1&bar=2) and HTML form does not have action attribute. And then emulate submit via Kerodon's press function, so Kerodon will create POST URL by kerodon.impl/build-url from request. So in this case, Kerodon creates broken URL like http://example.com/postfoo=1&bar=2 (without ? for separator), and then I can see 404 error.