From 4966070c4247d7124f27d6655162c7d31de48445 Mon Sep 17 00:00:00 2001
From: Marcela Ribeiro de Oliveira <mro15@inf.ufpr.br>
Date: Thu, 1 Feb 2018 09:53:36 -0200
Subject: [PATCH] fix rspec contacts tests for new policies

---
 spec/acceptance/contacts_spec.rb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/spec/acceptance/contacts_spec.rb b/spec/acceptance/contacts_spec.rb
index c559d3664..d276e6d93 100644
--- a/spec/acceptance/contacts_spec.rb
+++ b/spec/acceptance/contacts_spec.rb
@@ -18,6 +18,7 @@
 # along with portalmec.  If not, see <http://www.gnu.org/licenses/>.
 
 require 'acceptance_helpers'
+require 'shared/contexts'
 
 resource 'Contacts' do
 
@@ -28,6 +29,7 @@ resource 'Contacts' do
   let(:contacts) { Contact.all }
 
   get '/v1/contacts' do
+    include_context "authenticate_user_editor"
 
     example_request 'Getting all contacts' do
       expect(status).to eq(200)
@@ -35,6 +37,7 @@ resource 'Contacts' do
   end
 
   get '/v1/contacts/:id' do
+    include_context "authenticate_user_editor"
 
     let(:id) { contacts.first.id }
 
@@ -61,6 +64,7 @@ resource 'Contacts' do
   end
 
   put '/v1/contacts/:id' do
+    include_context "authenticate_user_editor"
 
     parameter :name, 'The name of the contact', scope: :contact
     parameter :email, 'The email of the contact', scope: :contact
@@ -78,6 +82,7 @@ resource 'Contacts' do
   end
 
   delete '/v1/contacts/:id' do
+    include_context "authenticate_user_editor"
 
     let(:id) { contacts.first.id }
 
-- 
GitLab