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

Use wrapped Rails request helpers instead of custom ones #51

Merged
merged 7 commits into from
Sep 14, 2017

Conversation

imtayadeway
Copy link
Contributor

@imtayadeway imtayadeway commented Sep 11, 2017

By wrapping Session#process to do a little extra work for us (namely defaulting to :as => :json for PUT/PATCH/POST and merging in the request headers that are created by the basic_authorize method), the run_get, run_post, etc. helpers become transparent wrappers for the request helpers provided by Rails, meaning that we can simply use those ones instead. I think this will provide a better experience for new contributors who will be more familiar with these helpers (if they are a Rails developer).

@miq-bot add-label refactoring, test
@miq-bot assign @abellotti

@imtayadeway
Copy link
Contributor Author

Ah yes, the new syntax. I'll see if I can do something about that.

@miq-bot add-label wip

@miq-bot miq-bot changed the title Patch Session#process [WIP] Patch Session#process Sep 11, 2017
@miq-bot miq-bot added the wip label Sep 11, 2017
@imtayadeway imtayadeway force-pushed the patch-session-process branch 2 times, most recently from cb04833 to b3dec52 Compare September 13, 2017 15:29
@imtayadeway
Copy link
Contributor Author

@miq-bot rm-label wip

@miq-bot miq-bot changed the title [WIP] Patch Session#process Patch Session#process Sep 13, 2017
@miq-bot miq-bot removed the wip label Sep 13, 2017
@imtayadeway imtayadeway changed the title Patch Session#process Patch Session#process as an alternative to providing wrappers for request helpers Sep 13, 2017
@imtayadeway imtayadeway changed the title Patch Session#process as an alternative to providing wrappers for request helpers Patch request helpers as an alternative to wrapping them Sep 14, 2017
@imtayadeway imtayadeway changed the title Patch request helpers as an alternative to wrapping them Use wrapped Rails request helpers instead of custom ones Sep 14, 2017
Creates a `RequestHelpers` module in a distinct `Spec::Support::Api`
namespace (and moves the `ApiHelper` in there for consistency) with
patched versions of the request helpers provided by Rails.
@miq-bot
Copy link
Member

miq-bot commented Sep 14, 2017

Checked commits imtayadeway/manageiq-api@53ca003~...0fdf463 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
74 files checked, 0 offenses detected
Everything looks fine. 🏆

Copy link
Member

@chrisarcand chrisarcand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paired on this with @imtayadeway and happy with the results 👍 LGTM

@chrisarcand chrisarcand merged commit fdddd25 into ManageIQ:master Sep 14, 2017
@chrisarcand chrisarcand added this to the Sprint 69 Ending Sep 18, 2017 milestone Sep 14, 2017
@chrisarcand chrisarcand self-assigned this Sep 14, 2017
@imtayadeway imtayadeway deleted the patch-session-process branch January 12, 2018 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants