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
Testing for missing values on a PUT request, it would be nice to have the following supported via extra_params with a example_request.
put'/users'doparameter:first_name,'Users first name',scope: :userparameter:last_name,'Users last name',scope: :userexample_request'with attributes',user: {first_name: 'John'}dostatus.should == 200endexample_request'without set attributes'dostatus.should == 422endend
Currently this function is not "additive" but instead it overrides the entire user key with a new value. I am not sure if you want to use a different DSL for doing this sort of operation (like allowing some form of lets inside example_request blocks or a different syntax for specifying additive versus overwriting parameters).
Let me know what approach you'd like, as I am eager to contribute back to this awesome project!
The text was updated successfully, but these errors were encountered:
So this should work but might not work how you expect.
put'/users'doparameter:first_name,'Users first name',scope: :userparameter:last_name,'Users last name',scope: :userexample_request'with attributes',first_name: 'John'do# first name will be scoped inside user by #paramsparams.should == {:user=>{:first_name=>'John'}}status.should == 200endend
If we can think of a way to make this more how you would expect it to work I'd definitely accept it.
Background
Testing for missing values on a PUT request, it would be nice to have the following supported via
extra_params
with aexample_request
.Currently this function is not "additive" but instead it overrides the entire
user
key with a new value. I am not sure if you want to use a different DSL for doing this sort of operation (like allowing some form of lets inside example_request blocks or a different syntax for specifying additive versus overwriting parameters).Let me know what approach you'd like, as I am eager to contribute back to this awesome project!
The text was updated successfully, but these errors were encountered: