shard-kemal/spec
Imran Latif c42f1f88e9 Added support for magic param _method just like Rails, Sinatra.
Following are the changes made in this commit:

- Added support for magic param `_method` just like Rails, Sinatra
etc.. Browsers which don't support `PUT`, `PATCH` and `DELETE` methods
can simulate them by sending `method` param in request body.

- The default Content-Type to parse request body submitted via forms
etc. is `application/x-www-form-urlencoded`. But if we send Ajax
request in Chrome ($.post) then by-default Content-Type is set to
`application/x-www-form-urlencoded; charset utf-8` which was not
getting matched. I changed the code from `==` to match against a
regular expression using `=~`.

- Print name and color of overridden HTTP method via Logger instead of
printing name and color or request's incoming HTTP method.

Making necessary changes as pointed by @sdogruyol

- Changed method name from`is_override_method_valid?` to
`override_method_valid?`.

- Refactored `if` condition in `override_method_valid?`.
2015-12-03 01:34:16 +05:00
..
all_spec.cr Handle POST request, and some refactors 2014-07-30 19:58:48 -03:00
config_spec.cr Updated logger to be more robust 2015-11-18 22:45:49 +02:00
context_spec.cr Refactored context 2015-10-30 22:34:44 +02:00
kemal_handler_spec.cr Added support for magic param _method just like Rails, Sinatra. 2015-12-03 01:34:16 +05:00
logger_spec.cr add colorize for logger 2015-11-22 20:06:26 +02:00
param_parser_spec.cr parse request body for array 2015-11-10 13:30:16 +02:00
route_spec.cr Fixed match bug 2015-10-31 09:28:25 +02:00
spec_helper.cr Set to development before_each spec 2015-11-25 23:35:04 +02:00