onyxframework / onyx

Powerful framework for modern applications 💪
https://api.onyxframework.com/onyx
MIT License
78 stars 5 forks source link

Enable cookies to be available at response with Onyx::HTTP::Spec #24

Closed RemiKalbe closed 5 years ago

RemiKalbe commented 5 years ago

I came across a case when I need to check a cookie from an HTTP request's response at testing.

RemiKalbe commented 5 years ago

It's pretty much synthetic sugar as you can use headers to check cookies, but it's more intuitive as you can use

context.response.cookies["cookie-name"]

with the onyx framework.

So using

response = Onyx::HTTP::Spec.method( ... )
response.cookies["cookie-name"]

with specs seems more seamless and logical

vladfaust commented 5 years ago

It's been merged.