From fe2295a60535124e0af6724c9528b2b145d30a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 19 Oct 2016 16:00:34 +0200 Subject: [PATCH] Add spec for unauthorized access --- spec/requests/api/v3/user/create_user_resource_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/requests/api/v3/user/create_user_resource_spec.rb b/spec/requests/api/v3/user/create_user_resource_spec.rb index 19bf8937b0..d05901313f 100644 --- a/spec/requests/api/v3/user/create_user_resource_spec.rb +++ b/spec/requests/api/v3/user/create_user_resource_spec.rb @@ -194,4 +194,14 @@ describe ::API::V3::Users::UsersAPI do .to include 'Status is not a valid status for new users.' end end + + describe 'unauthorized user' do + let(:user) { FactoryGirl.build(:user) } + let(:parameters) { { status: 'invited', email: 'foo@example.org' } } + + it 'returns an erroneous response' do + send_request + expect(response.status).to eq(403) + end + end end