提交 84fa0610 编写于 作者: D Dylan Griffith

Ensure runner_type is updated correctly when assigning shared runner to project

上级 063b6b75
......@@ -108,7 +108,11 @@ module Ci
end
def assign_to(project, current_user = nil)
self.is_shared = false if shared?
if shared?
self.is_shared = false if shared?
self.runner_type = :project_type
end
self.save
project.runner_projects.create(runner_id: self.id)
end
......
......@@ -207,6 +207,7 @@ describe Ci::Runner do
end
it { expect(shared_runner).to be_specific }
it { expect(shared_runner).to be_project_type }
it { expect(shared_runner.projects).to eq([project]) }
it { expect(shared_runner.only_for?(project)).to be_truthy }
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册