diff --git a/spec/acceptance/contacts_spec.rb b/spec/acceptance/contacts_spec.rb index c559d36643b9be32fdd5ccd670e3a8edca70aafb..d276e6d9326627044722dd8b2d7f6ad7e699fcf0 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 }