-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The road towards 2.0 #225
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Pinning to keep |
Some of this is actually already there, as illustrated by #235 - if you create an explicit session, you can use let(:digest_session) do
session = Rack::Test::Session.new(Rack::MockSession.new(digest_app))
session.digest_authorize('test-name', 'test-password')
session
end
it 'retries digest requests' do
session = digest_session
session.request('/')
expect(session.last_request.env['rack-test.digest_auth_retry']).to be_truthy
end |
I'm going to close this as #287 implements the query/body separation and I think #225 (comment) shows how you can already implement separate session support. I'm certainly open to to a major bump in the future if it is really required, but even in a major version bump I would try to keep backwards compatibility as much as possible. |
So there; 1.0.0 was just released: https://rubygems.org/gems/rack-test/versions/1.0.0, close to 9 years since the first public version (0.1.0) saw daylight.
This issue exists to track and discuss potential breaking changes & improvements that could be made on the way towards a potential 2.0.0 release (no release date given as of yet.).
Change the semantics re. request params and request body
It became clear from #223 and the preceding PRs that it might not always be entirely clear when making a request, if the parameters provided should go into the URL query parameters (
/foo?bar=baz&zot=qux
) or be encoded into the request body (normally as multi-part encoded, i.e.bar=baz&zot=qux
.)Some HTTP methods are more unequivocal than others:
The suggested approach would be to change the semantics to something like this:
Change to avoid using class-global state
The current way the gem is written is pretty nice and simple in one way, but: what if you are making multiple requests and need to e.g. compare the results between them? No can do; the gem uses a lot of temporal coupling and state from one request until the next request is being made.
This is fine for many use cases, but... what if we would be able to find a better way? Something like:
Arguably a bit more kludgy and ugly, but it would make some use cases a lot nicer. Making a mixin keep a lot of state when being used feels a bit impure in my eyes, but: I would be open to other people's opinions here also. Maybe it's just me and 1 000 000 of the rest of you are completely fine with the current API?
Your favourite feature here?
This is a work in progress - feel free to suggest improvements here.
The text was updated successfully, but these errors were encountered: