Commit 2d8c310f authored by Jacob Vosmaer's avatar Jacob Vosmaer

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.
parent 02b85fd2
......@@ -45,6 +45,7 @@ describe API, api: true do
end
it "should return nil for a user without access" do
env[API::APIHelpers::PRIVATE_TOKEN_HEADER] = user.private_token
Gitlab::UserAccess.stub(allowed?: false)
current_user.should be_nil
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment