You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get'/foo'doparameter:status,"Blah",method: :status_param# this param is not requiredexample'meh'doexpect(status).toeq200endend
Even before entering the example block, rspec api documentation calls status to prepare the request, because status_param is not defined. When it calls status, it fails with No response yet. Request a page first, because the status method is only supposed to be called after a request is done.
I don't see a reason to have this fallback mechanism. If the programmer specifies a different method name for a param, just use it if present, if not, do not use the param at all.
The reason will be displayed to describe this comment to others. Learn more.
Your example is working as intended. If instead the example is an example_request then we hit your failure, which does exist. Status is a weird method to override, and we've always had an issue with it.
The problem line seems like it would be this one. I will look at a PR if you want to fix it, otherwise I don't see why you would change the method and not define it.
The reason will be displayed to describe this comment to others. Learn more.
@oestrich The status was just an example, but this issue happens to other reserved words on the context of a test example as well. I created a PR: #352
Thanks
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #308
This PR add a
method
option that allows to use custom methods as a parameter valueFor example:
Also made some refactorings