Add regression test for escaping feature names #378
Merged
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.
@jnunemaker great idea about adding a regression test lemme know what ya think
7151715 was merged which escapes
feature_names like we were doing before the change to support slashes
and adding the FeatureNameFromRoute module for pulling the feature name
out of the request. This adds a regression spec to make sure this
continues to work in the future as changes are made.
I decided to test this in a separate describe block since the current
action_subclass
is super simple and really easy to understand what its testing. Since theFeatureNameFromRoute
returns a request body with values and includes a module, etc I think its nice to separate the two. Sincefeature_name
is a private method I didn't really want to test it usingsend
and instead decided to run the fake request via the publicrun
method like the other specs have. If you like this approach I'll add the same forApi::Action
just lemme know. Totally open to other suggestions to better test this tooI decided to stub
path_info
instead of add the headerPATH_INFO
toenv
because that feels like messing with internals of the path_info method and we just care about the public method and not how its implemented under the hood