Commit 2d8c310f11f6340e043da97dfc10f268a78c2d9e

Authored by Jacob Vosmaer
1 parent 02b85fd2

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.
Showing 1 changed file with 1 additions and 0 deletions   Show diff stats
spec/requests/api/api_helpers_spec.rb
@@ -45,6 +45,7 @@ describe API, api: true do @@ -45,6 +45,7 @@ describe API, api: true do
45 end 45 end
46 46
47 it "should return nil for a user without access" do 47 it "should return nil for a user without access" do
  48 + env[API::APIHelpers::PRIVATE_TOKEN_HEADER] = user.private_token
48 Gitlab::UserAccess.stub(allowed?: false) 49 Gitlab::UserAccess.stub(allowed?: false)
49 current_user.should be_nil 50 current_user.should be_nil
50 end 51 end