diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-10-12 15:38:39 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-02 13:39:03 +0300 |
commit | 3f24f9ed182f5226210349b8e67e484e132ce971 (patch) | |
tree | 6f6a9148f3d89ea2d19cefe90470a8dca4dabc64 /spec/requests/api/helpers_spec.rb | |
parent | a1781a49416790f727b3dd3453bf704723e72b90 (diff) |
Add sudo API scope
Diffstat (limited to 'spec/requests/api/helpers_spec.rb')
-rw-r--r-- | spec/requests/api/helpers_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/requests/api/helpers_spec.rb b/spec/requests/api/helpers_spec.rb index 0ab9f94376c..9631324607f 100644 --- a/spec/requests/api/helpers_spec.rb +++ b/spec/requests/api/helpers_spec.rb @@ -173,18 +173,18 @@ describe API::Helpers do expect { current_user }.to raise_error /401/ end - it "returns a 401 response for a user without access" do + it "returns a 403 response for a user without access" do env[API::APIGuard::PRIVATE_TOKEN_HEADER] = personal_access_token.token allow_any_instance_of(Gitlab::UserAccess).to receive(:allowed?).and_return(false) - expect { current_user }.to raise_error /401/ + expect { current_user }.to raise_error /403/ end - it 'returns a 401 response for a user who is blocked' do + it 'returns a 403 response for a user who is blocked' do user.block! env[API::APIGuard::PRIVATE_TOKEN_HEADER] = personal_access_token.token - expect { current_user }.to raise_error /401/ + expect { current_user }.to raise_error /403/ end it "leaves user as is when sudo not specified" do |