Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-05-15 12:30:50 +0400
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-05-15 12:30:50 +0400
commit2d8c310f11f6340e043da97dfc10f268a78c2d9e (patch)
treea9c44f09b98876f945707c1974f141469a31e8d7 /spec
parent02b85fd2366bc6c0d3194ab68e13eb6291733c26 (diff)
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.rb1
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