Test grace auth against gitlab_ci_project with token
This commit is contained in:
parent
ce19e1739e
commit
04c4445ae0
1 changed files with 4 additions and 1 deletions
|
@ -175,11 +175,14 @@ describe Grack::Auth do
|
|||
|
||||
context "when a gitlab ci token is provided" do
|
||||
let(:token) { "123" }
|
||||
let(:gitlab_ci_project) { FactoryGirl.create :ci_project, token: token }
|
||||
|
||||
before do
|
||||
project.gitlab_ci_project = gitlab_ci_project
|
||||
project.save
|
||||
|
||||
gitlab_ci_service = project.build_gitlab_ci_service
|
||||
gitlab_ci_service.active = true
|
||||
allow(gitlab_ci_service).to receive(:token).and_return(token)
|
||||
gitlab_ci_service.save
|
||||
|
||||
env["HTTP_AUTHORIZATION"] = ActionController::HttpAuthentication::Basic.encode_credentials("gitlab-ci-token", token)
|
||||
|
|
Loading…
Reference in a new issue