Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taketo1113/f4ab9b5eb750d223b28245f0c91f5a19 to your computer and use it in GitHub Desktop.
Save taketo1113/f4ab9b5eb750d223b28245f0c91f5a19 to your computer and use it in GitHub Desktop.
Fix 'DEPRECATION WARNING: The success? predicate is deprecated and will be removed in Rails 6.0. Please use successful?'
  • Error
DEPRECATION WARNING: The success? predicate is deprecated and will be removed in Rails 6.0. Please use successful?
  • Sample code
  # deprecated
  expect(response).to be_success
 
  # collect
  expect(response).to be_successful
  • Replace code in spec
$ grep -rl be_success ./spec/* | xargs sed -i'' "s/be_success/be_successful/g"
@m-k
Copy link

m-k commented Dec 19, 2018

For OS X:

$ grep -rl be_success ./spec/* | xargs sed -i'' -e "s/be_success/be_successful/g"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment