From 49d5c35b6948f7dd9fcae4ccfcad33d6d873c21e Mon Sep 17 00:00:00 2001
From: Tomasz Maczukin <tomasz@maczukin.pl>
Date: Wed, 17 Feb 2016 22:56:33 +0100
Subject: [PATCH] Fix old usages of `ci_runner` factory

---
 spec/features/runners_spec.rb | 10 +++++-----
 spec/models/build_spec.rb     |  6 +++---
 spec/models/ci/runner_spec.rb | 14 +++++++-------
 spec/models/project_spec.rb   |  4 ++--
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb
index d97831aae14..e8886e7edf9 100644
--- a/spec/features/runners_spec.rb
+++ b/spec/features/runners_spec.rb
@@ -17,10 +17,10 @@ describe "Runners" do
       @project3 = FactoryGirl.create :empty_project
       @project3.team << [user, :developer]
 
-      @shared_runner = FactoryGirl.create :ci_shared_runner
-      @specific_runner = FactoryGirl.create :ci_specific_runner
-      @specific_runner2 = FactoryGirl.create :ci_specific_runner
-      @specific_runner3 = FactoryGirl.create :ci_specific_runner
+      @shared_runner = FactoryGirl.create :ci_runner, :shared
+      @specific_runner = FactoryGirl.create :ci_runner
+      @specific_runner2 = FactoryGirl.create :ci_runner
+      @specific_runner3 = FactoryGirl.create :ci_runner
       @project.runners << @specific_runner
       @project2.runners << @specific_runner2
       @project3.runners << @specific_runner3
@@ -84,7 +84,7 @@ describe "Runners" do
     before do
       @project = FactoryGirl.create :empty_project
       @project.team << [user, :master]
-      @specific_runner = FactoryGirl.create :ci_specific_runner
+      @specific_runner = FactoryGirl.create :ci_runner
       @project.runners << @specific_runner
     end
 
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index 606340d87e4..0acf6e6588a 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -243,7 +243,7 @@ describe Ci::Build, models: true do
   end
 
   describe :can_be_served? do
-    let(:runner) { FactoryGirl.create :ci_specific_runner }
+    let(:runner) { FactoryGirl.create :ci_runner }
 
     before { build.project.runners << runner }
 
@@ -285,7 +285,7 @@ describe Ci::Build, models: true do
     end
 
     context 'if there are runner' do
-      let(:runner) { FactoryGirl.create :ci_specific_runner }
+      let(:runner) { FactoryGirl.create :ci_runner }
 
       before do
         build.project.runners << runner
@@ -322,7 +322,7 @@ describe Ci::Build, models: true do
         it { is_expected.to be_truthy }
 
         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
             build.project.runners << runner
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb
index 232760dfeba..e891838672e 100644
--- a/spec/models/ci/runner_spec.rb
+++ b/spec/models/ci/runner_spec.rb
@@ -39,7 +39,7 @@ describe Ci::Runner, models: true do
 
   describe :assign_to do
     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) }
 
@@ -52,15 +52,15 @@ describe Ci::Runner, models: true do
     subject { Ci::Runner.online }
 
     before do
-      @runner1 = FactoryGirl.create(:ci_shared_runner, contacted_at: 1.year.ago)
-      @runner2 = FactoryGirl.create(:ci_shared_runner, contacted_at: 1.second.ago)
+      @runner1 = FactoryGirl.create(:ci_runner, :shared, contacted_at: 1.year.ago)
+      @runner2 = FactoryGirl.create(:ci_runner, :shared, contacted_at: 1.second.ago)
     end
 
     it { is_expected.to eq([@runner2])}
   end
 
   describe :online? do
-    let(:runner) { FactoryGirl.create(:ci_shared_runner) }
+    let(:runner) { FactoryGirl.create(:ci_runner, :shared) }
 
     subject { runner.online? }
 
@@ -84,7 +84,7 @@ describe Ci::Runner, models: true do
   end
 
   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 }
 
@@ -115,7 +115,7 @@ describe Ci::Runner, models: true do
 
   describe "belongs_to_one_project?" 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)
       project1 = FactoryGirl.create(:empty_project)
       project.runners << runner
@@ -125,7 +125,7 @@ describe Ci::Runner, models: true do
     end
 
     it "returns true" do
-      runner = FactoryGirl.create(:ci_specific_runner)
+      runner = FactoryGirl.create(:ci_runner)
       project = FactoryGirl.create(:empty_project)
       project.runners << runner
 
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index a3de23369e1..3ccb627a259 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -519,8 +519,8 @@ describe Project, models: true do
 
   describe :any_runners do
     let(:project) { create(:empty_project, shared_runners_enabled: shared_runners_enabled) }
-    let(:specific_runner) { create(:ci_specific_runner) }
-    let(:shared_runner) { create(:ci_shared_runner) }
+    let(:specific_runner) { create(:ci_runner) }
+    let(:shared_runner) { create(:ci_runner, :shared) }
 
     context 'for shared runners disabled' do
       let(:shared_runners_enabled) { false }
-- 
GitLab