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:
Jacob Vosmaer 2014-05-15 10:30:50 +02:00
parent 02b85fd236
commit 2d8c310f11

View file

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