Commit 84fa0610 authored by Dylan Griffith's avatar Dylan Griffith

Ensure runner_type is updated correctly when assigning shared runner to project

parent 063b6b75
...@@ -108,7 +108,11 @@ module Ci ...@@ -108,7 +108,11 @@ module Ci
end end
def assign_to(project, current_user = nil) def assign_to(project, current_user = nil)
if shared?
self.is_shared = false 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 ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment