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 ...@@ -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
......
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