From 2d8c310f11f6340e043da97dfc10f268a78c2d9e Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Thu, 15 May 2014 10:30:50 +0200 Subject: [PATCH] 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. --- spec/requests/api/api_helpers_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/requests/api/api_helpers_spec.rb b/spec/requests/api/api_helpers_spec.rb index a4869476574..e2f222c0d34 100644 --- a/spec/requests/api/api_helpers_spec.rb +++ b/spec/requests/api/api_helpers_spec.rb @@ -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