From 453d386c154a3a801eac288457599d602acb316e Mon Sep 17 00:00:00 2001
From: Giovanne Marcelo <gms15@inf.ufpr.br>
Date: Thu, 16 Feb 2017 17:02:44 -0200
Subject: [PATCH] Add authentication shared context

---
 spec/shared/contexts.rb | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 spec/shared/contexts.rb

diff --git a/spec/shared/contexts.rb b/spec/shared/contexts.rb
new file mode 100644
index 00000000..040826c3
--- /dev/null
+++ b/spec/shared/contexts.rb
@@ -0,0 +1,14 @@
+require 'rails_helper'
+require 'rspec_api_documentation'
+require 'rspec_api_documentation/dsl'
+require 'spec_helper'
+
+RSpec.shared_context "authentication", shared_context: :metadata do
+  let(:auth_client) { @auth_headers['client'] }
+  let(:uid) { @auth_headers['uid'] }
+  let(:access_token) { @auth_headers['access-token'] }
+
+  def authenticate(user)
+    @auth_headers = user.create_new_auth_token
+  end
+end
-- 
GitLab