summaryrefslogtreecommitdiff
path: root/spec/support/json_response_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/json_response_helpers.rb')
-rw-r--r--spec/support/json_response_helpers.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/json_response_helpers.rb b/spec/support/json_response_helpers.rb
new file mode 100644
index 00000000000..e8d2ef2d7f0
--- /dev/null
+++ b/spec/support/json_response_helpers.rb
@@ -0,0 +1,9 @@
+shared_context 'JSON response' do
+ let(:json_response) { JSON.parse(response.body) }
+end
+
+RSpec.configure do |config|
+ config.include_context 'JSON response', type: :controller
+ config.include_context 'JSON response', type: :request
+ config.include_context 'JSON response', :api
+end