Commit 49d5c35b authored by Tomasz Maczukin's avatar Tomasz Maczukin

Fix old usages of `ci_runner` factory

parent acfe25ed
...@@ -17,10 +17,10 @@ describe "Runners" do ...@@ -17,10 +17,10 @@ describe "Runners" do
@project3 = FactoryGirl.create :empty_project @project3 = FactoryGirl.create :empty_project
@project3.team << [user, :developer] @project3.team << [user, :developer]
@shared_runner = FactoryGirl.create :ci_shared_runner @shared_runner = FactoryGirl.create :ci_runner, :shared
@specific_runner = FactoryGirl.create :ci_specific_runner @specific_runner = FactoryGirl.create :ci_runner
@specific_runner2 = FactoryGirl.create :ci_specific_runner @specific_runner2 = FactoryGirl.create :ci_runner
@specific_runner3 = FactoryGirl.create :ci_specific_runner @specific_runner3 = FactoryGirl.create :ci_runner
@project.runners << @specific_runner @project.runners << @specific_runner
@project2.runners << @specific_runner2 @project2.runners << @specific_runner2
@project3.runners << @specific_runner3 @project3.runners << @specific_runner3
...@@ -84,7 +84,7 @@ describe "Runners" do ...@@ -84,7 +84,7 @@ describe "Runners" do
before do before do
@project = FactoryGirl.create :empty_project @project = FactoryGirl.create :empty_project
@project.team << [user, :master] @project.team << [user, :master]
@specific_runner = FactoryGirl.create :ci_specific_runner @specific_runner = FactoryGirl.create :ci_runner
@project.runners << @specific_runner @project.runners << @specific_runner
end end
......
...@@ -243,7 +243,7 @@ describe Ci::Build, models: true do ...@@ -243,7 +243,7 @@ describe Ci::Build, models: true do
end end
describe :can_be_served? do describe :can_be_served? do
let(:runner) { FactoryGirl.create :ci_specific_runner } let(:runner) { FactoryGirl.create :ci_runner }
before { build.project.runners << runner } before { build.project.runners << runner }
...@@ -285,7 +285,7 @@ describe Ci::Build, models: true do ...@@ -285,7 +285,7 @@ describe Ci::Build, models: true do
end end
context 'if there are runner' do context 'if there are runner' do
let(:runner) { FactoryGirl.create :ci_specific_runner } let(:runner) { FactoryGirl.create :ci_runner }
before do before do
build.project.runners << runner build.project.runners << runner
...@@ -322,7 +322,7 @@ describe Ci::Build, models: true do ...@@ -322,7 +322,7 @@ describe Ci::Build, models: true do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
context "and there are specific runner" do context "and there are specific runner" do
let(:runner) { FactoryGirl.create :ci_specific_runner, contacted_at: 1.second.ago } let(:runner) { FactoryGirl.create :ci_runner, contacted_at: 1.second.ago }
before do before do
build.project.runners << runner build.project.runners << runner
......
...@@ -39,7 +39,7 @@ describe Ci::Runner, models: true do ...@@ -39,7 +39,7 @@ describe Ci::Runner, models: true do
describe :assign_to do describe :assign_to do
let!(:project) { FactoryGirl.create :empty_project } let!(:project) { FactoryGirl.create :empty_project }
let!(:shared_runner) { FactoryGirl.create(:ci_shared_runner) } let!(:shared_runner) { FactoryGirl.create(:ci_runner, :shared) }
before { shared_runner.assign_to(project) } before { shared_runner.assign_to(project) }
...@@ -52,15 +52,15 @@ describe Ci::Runner, models: true do ...@@ -52,15 +52,15 @@ describe Ci::Runner, models: true do
subject { Ci::Runner.online } subject { Ci::Runner.online }
before do before do
@runner1 = FactoryGirl.create(:ci_shared_runner, contacted_at: 1.year.ago) @runner1 = FactoryGirl.create(:ci_runner, :shared, contacted_at: 1.year.ago)
@runner2 = FactoryGirl.create(:ci_shared_runner, contacted_at: 1.second.ago) @runner2 = FactoryGirl.create(:ci_runner, :shared, contacted_at: 1.second.ago)
end end
it { is_expected.to eq([@runner2])} it { is_expected.to eq([@runner2])}
end end
describe :online? do describe :online? do
let(:runner) { FactoryGirl.create(:ci_shared_runner) } let(:runner) { FactoryGirl.create(:ci_runner, :shared) }
subject { runner.online? } subject { runner.online? }
...@@ -84,7 +84,7 @@ describe Ci::Runner, models: true do ...@@ -84,7 +84,7 @@ describe Ci::Runner, models: true do
end end
describe :status do describe :status do
let(:runner) { FactoryGirl.create(:ci_shared_runner, contacted_at: 1.second.ago) } let(:runner) { FactoryGirl.create(:ci_runner, :shared, contacted_at: 1.second.ago) }
subject { runner.status } subject { runner.status }
...@@ -115,7 +115,7 @@ describe Ci::Runner, models: true do ...@@ -115,7 +115,7 @@ describe Ci::Runner, models: true do
describe "belongs_to_one_project?" do describe "belongs_to_one_project?" do
it "returns false if there are two projects runner assigned to" do it "returns false if there are two projects runner assigned to" do
runner = FactoryGirl.create(:ci_specific_runner) runner = FactoryGirl.create(:ci_runner)
project = FactoryGirl.create(:empty_project) project = FactoryGirl.create(:empty_project)
project1 = FactoryGirl.create(:empty_project) project1 = FactoryGirl.create(:empty_project)
project.runners << runner project.runners << runner
...@@ -125,7 +125,7 @@ describe Ci::Runner, models: true do ...@@ -125,7 +125,7 @@ describe Ci::Runner, models: true do
end end
it "returns true" do it "returns true" do
runner = FactoryGirl.create(:ci_specific_runner) runner = FactoryGirl.create(:ci_runner)
project = FactoryGirl.create(:empty_project) project = FactoryGirl.create(:empty_project)
project.runners << runner project.runners << runner
......
...@@ -519,8 +519,8 @@ describe Project, models: true do ...@@ -519,8 +519,8 @@ describe Project, models: true do
describe :any_runners do describe :any_runners do
let(:project) { create(:empty_project, shared_runners_enabled: shared_runners_enabled) } let(:project) { create(:empty_project, shared_runners_enabled: shared_runners_enabled) }
let(:specific_runner) { create(:ci_specific_runner) } let(:specific_runner) { create(:ci_runner) }
let(:shared_runner) { create(:ci_shared_runner) } let(:shared_runner) { create(:ci_runner, :shared) }
context 'for shared runners disabled' do context 'for shared runners disabled' do
let(:shared_runners_enabled) { false } let(:shared_runners_enabled) { false }
......
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