Created
June 21, 2018 08:15
-
-
Save wtnabe/9c0c810912b6f3ae0349e39a7eba5ea4 to your computer and use it in GitHub Desktop.
post json in request spec w/ rspec-rails 3.5+ + rails 5+
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
it { | |
post :path, params: <hash>, headers: {content_type: :json} | |
} | |
or | |
it { | |
post "#{path}.json", params: <hash> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment