Skip to content
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

Add ability to pass array parameters to requests #48

Closed
wants to merge 2 commits into from
Closed

Add ability to pass array parameters to requests #48

wants to merge 2 commits into from

Conversation

rilian
Copy link

@rilian rilian commented Aug 28, 2012

now it is possible to send

  do_request(:array => [1, 2])

and get in controller

  params[:array] == [1, 2]

@travisbot
Copy link

This pull request fails (merged a96ef34 into 4c76c40).

@rilian
Copy link
Author

rilian commented Aug 28, 2012

timeout on travis :)

@oestrich
Copy link
Contributor

If it's possible, I think using the Rack::Test::Utils#build_nested_query helper for this would be cleaner.

https://github.com/brynary/rack-test/blob/master/lib/rack/test/utils.rb#L7

@rilian
Copy link
Author

rilian commented Aug 28, 2012

hi @oestrich , do you have a working example of it with rspec_api_documentation ?

@oestrich
Copy link
Contributor

I don't, but you can see it being called here

https://github.com/brynary/rack-test/blob/master/lib/rack/test.rb#L198

My guess is that you can just call it directly since it's a module function.

@rilian
Copy link
Author

rilian commented Aug 28, 2012

so you propose to get rid of do_request at all ?

and send requests through client.get(path, params, headers)

@oestrich
Copy link
Contributor

Could you extend the HTML output feature to send a an array, as well as the OAuth2 feature? What you wrote seems to be mostly for documentation purposes, and we just want to verify that.

I don't think we'd get rid of do_request, but if we can knock most of the complexity out of it and let Rack::Test and the other clients handle it, that'd be great.

@rilian
Copy link
Author

rilian commented Aug 29, 2012

yep - we use this gem and specs DSL purely for documenting the API ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants