diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-05-15 10:30:50 +0200 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-05-15 10:30:50 +0200 |
commit | 2d8c310f11f6340e043da97dfc10f268a78c2d9e (patch) | |
tree | a9c44f09b98876f945707c1974f141469a31e8d7 /spec | |
parent | 02b85fd2366bc6c0d3194ab68e13eb6291733c26 (diff) | |
download | gitlab-ce-2d8c310f11f6340e043da97dfc10f268a78c2d9e.tar.gz |
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.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/api_helpers_spec.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |