Make user access test pass for the right reason
If we do not set a private token during the test, current_user will be nil because the user is not found, not due to the access check.
This commit is contained in:
parent
02b85fd236
commit
2d8c310f11
1 changed files with 1 additions and 0 deletions
|
@ -45,6 +45,7 @@ describe API, api: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should return nil for a user without access" do
|
it "should return nil for a user without access" do
|
||||||
|
env[API::APIHelpers::PRIVATE_TOKEN_HEADER] = user.private_token
|
||||||
Gitlab::UserAccess.stub(allowed?: false)
|
Gitlab::UserAccess.stub(allowed?: false)
|
||||||
current_user.should be_nil
|
current_user.should be_nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue