Before Rails 5, I used to write “request specs” using rspec as below:
After upgrading to Rails 5, when I run the spec above I got the following error:
According to the error message above, get
method expects 1 argument instead of 3. Trying to debug the error was redirected me to actionpack-5.1.3/lib/action_dispatch/testing/integration.rb
file. I found the definition of get
method around line 15:
Replacing the get
method call in the spec code as below solved the problem:
See this stackoverflow post how to use splat and double splat.