Ensure runner_type is updated correctly when assigning shared runner to project
This commit is contained in:
parent
063b6b75be
commit
84fa061086
|
@ -108,7 +108,11 @@ module Ci
|
||||||
end
|
end
|
||||||
|
|
||||||
def assign_to(project, current_user = nil)
|
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
|
self.save
|
||||||
project.runner_projects.create(runner_id: self.id)
|
project.runner_projects.create(runner_id: self.id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -207,6 +207,7 @@ describe Ci::Runner do
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(shared_runner).to be_specific }
|
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.projects).to eq([project]) }
|
||||||
it { expect(shared_runner.only_for?(project)).to be_truthy }
|
it { expect(shared_runner.only_for?(project)).to be_truthy }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue