From 7e55023737e6dd77aa3466536603d163a735eac4 Mon Sep 17 00:00:00 2001
From: Giovanne Marcelo <gms15@inf.ufpr.br>
Date: Thu, 16 Feb 2017 17:04:35 -0200
Subject: [PATCH] Add default headers

---
 spec/acceptance_helpers.rb | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/spec/acceptance_helpers.rb b/spec/acceptance_helpers.rb
index d1ce52c9..ad427c21 100644
--- a/spec/acceptance_helpers.rb
+++ b/spec/acceptance_helpers.rb
@@ -1,6 +1,7 @@
 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
-- 
GitLab