-
-
Save griffinqiu/f21c0b42c55528f7e405dcc0c10ab457 to your computer and use it in GitHub Desktop.
Search and replace to add `params` in controller tests when upgrading rails to 5.1 in Vim
This file contains 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
/\v^(\s+)(get|post|put|patch|destroy) :(\w+), ([^params].+[^,])$ | |
:%s//\1\2 :\3, params: { \4 }/g | |
:%s/\v^(\s+)(get|post|put|patch|destroy) :(\w+), ([^params].+[^,])$/\1\2 :\3, params: { \4 }/g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment