Skip to content
Snippets Groups Projects
Commit 7e550237 authored by Giovanne Marcelo's avatar Giovanne Marcelo
Browse files

Add default headers

parent 453d386c
No related branches found
No related tags found
No related merge requests found
require 'rails_helper'
require 'rspec_api_documentation'
require 'rspec_api_documentation/dsl'
require 'spec_helper'
RspecApiDocumentation.configure do |config|
config.format = [:json, :combined_text, :html, :markdown]
......@@ -8,6 +9,18 @@ RspecApiDocumentation.configure do |config|
config.api_name = 'PortalMEC API'
end
RSpec.configure do |config|
config.before(:each) do |spec|
if spec.metadata[:type].equal? :acceptance
header 'Accept', 'application/json'
header 'Content-Type', 'application/json'
header 'access-token', :access_token
header 'client', :auth_client
header 'uid', :uid
end
end
end
module Helper
def self.serialize(objects)
serializer = objects.is_a?(Array) || objects.is_a?(ActiveRecord::Relation) ? ActiveModel::Serializer::CollectionSerializer : "#{objects.class.name}Serializer".constantize
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment