diff --git a/app/models/project_services/ci/hip_chat_message.rb b/app/models/project_services/ci/hip_chat_message.rb
index 3e9f99e7eaf7bbb734c5001ac59efbf104a3a2e5..58825fe066c8f62ff2ca74e1d6b2964974ee9790 100644
--- a/app/models/project_services/ci/hip_chat_message.rb
+++ b/app/models/project_services/ci/hip_chat_message.rb
@@ -11,7 +11,7 @@ module Ci
       lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_url(project)}\">#{project.name}</a> - ")
       
       if commit.matrix?
-        lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_ref_commit_url(project, commit.ref, commit.sha)}\">Commit ##{commit.id}</a></br>")
+        lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_ref_commits_url(project, commit.ref, commit.sha)}\">Commit ##{commit.id}</a></br>")
       else
         first_build = commit.builds_without_retry.first
         lines.push("<a href=\"#{Ci::RoutesHelper.ci_project_build_url(project, first_build)}\">Build '#{first_build.name}' ##{first_build.id}</a></br>")
diff --git a/app/models/project_services/ci/slack_message.rb b/app/models/project_services/ci/slack_message.rb
index 7d884849bf3ce8e7953822d6fa008227c305273e..491ace501112c84affb646db7f41a7d6a1457c5d 100644
--- a/app/models/project_services/ci/slack_message.rb
+++ b/app/models/project_services/ci/slack_message.rb
@@ -46,10 +46,10 @@ module Ci
     def attachment_message
       out = "<#{Ci::RoutesHelper.ci_project_url(project)}|#{project_name}>: "
       if commit.matrix?
-        out << "Commit <#{Ci::RoutesHelper.ci_project_ref_commit_url(project, commit.ref, commit.sha)}|\##{commit.id}> "
+        out << "Commit <#{Ci::RoutesHelper.ci_project_ref_commits_url(project, commit.ref, commit.sha)}|\##{commit.id}> "
       else
         build = commit.builds_without_retry.first
-        out << "Build <#{Ci::RoutesHelper.ci_project_build_url(project, build)}|\##{build.id}> "
+        out << "Build <#{Ci::RoutesHelper.ci_project_build_path(project, build)}|\##{build.id}> "
       end
       out << "(<#{commit_sha_link}|#{commit.short_sha}>) "
       out << "of <#{commit_ref_link}|#{commit.ref}> "
diff --git a/spec/features/ci/admin/builds_spec.rb b/spec/features/ci/admin/builds_spec.rb
index d524dc29795f761f30e9eb39f9e9ad713306783e..88ef9c144af14b29b0a17d059fb2bf95ec9b9881 100644
--- a/spec/features/ci/admin/builds_spec.rb
+++ b/spec/features/ci/admin/builds_spec.rb
@@ -1,19 +1,19 @@
 require 'spec_helper'
 
 describe "Admin Builds" do
-  let(:project) { FactoryGirl.create :project }
-  let(:commit) { FactoryGirl.create :commit, project: project }
-  let(:build) { FactoryGirl.create :build, commit: commit }
+  let(:project) { FactoryGirl.create :ci_project }
+  let(:commit) { FactoryGirl.create :ci_commit, project: project }
+  let(:build) { FactoryGirl.create :ci_build, commit: commit }
 
   before do
-    skip_admin_auth
+    skip_ci_admin_auth
     login_as :user
   end
 
   describe "GET /admin/builds" do
     before do
       build
-      visit admin_builds_path
+      visit ci_admin_builds_path
     end
 
     it { expect(page).to have_content "All builds" }
@@ -22,23 +22,23 @@ describe "Admin Builds" do
 
   describe "Tabs" do
     it "shows all builds" do
-      build = FactoryGirl.create :build, commit: commit, status: "pending"
-      build1 = FactoryGirl.create :build, commit: commit, status: "running"
-      build2 = FactoryGirl.create :build, commit: commit, status: "success"
-      build3 = FactoryGirl.create :build, commit: commit, status: "failed"
+      build = FactoryGirl.create :ci_build, commit: commit, status: "pending"
+      build1 = FactoryGirl.create :ci_build, commit: commit, status: "running"
+      build2 = FactoryGirl.create :ci_build, commit: commit, status: "success"
+      build3 = FactoryGirl.create :ci_build, commit: commit, status: "failed"
 
-      visit admin_builds_path
+      visit ci_admin_builds_path
 
       expect(page.all(".build-link").size).to eq(4)
     end
 
     it "shows pending builds" do
-      build = FactoryGirl.create :build, commit: commit, status: "pending"
-      build1 = FactoryGirl.create :build, commit: commit, status: "running"
-      build2 = FactoryGirl.create :build, commit: commit, status: "success"
-      build3 = FactoryGirl.create :build, commit: commit, status: "failed"
+      build = FactoryGirl.create :ci_build, commit: commit, status: "pending"
+      build1 = FactoryGirl.create :ci_build, commit: commit, status: "running"
+      build2 = FactoryGirl.create :ci_build, commit: commit, status: "success"
+      build3 = FactoryGirl.create :ci_build, commit: commit, status: "failed"
 
-      visit admin_builds_path
+      visit ci_admin_builds_path
 
       within ".nav.nav-tabs" do
         click_on "Pending"
@@ -51,12 +51,12 @@ describe "Admin Builds" do
     end
 
     it "shows running builds" do
-      build = FactoryGirl.create :build, commit: commit, status: "pending"
-      build1 = FactoryGirl.create :build, commit: commit, status: "running"
-      build2 = FactoryGirl.create :build, commit: commit, status: "success"
-      build3 = FactoryGirl.create :build, commit: commit, status: "failed"
+      build = FactoryGirl.create :ci_build, commit: commit, status: "pending"
+      build1 = FactoryGirl.create :ci_build, commit: commit, status: "running"
+      build2 = FactoryGirl.create :ci_build, commit: commit, status: "success"
+      build3 = FactoryGirl.create :ci_build, commit: commit, status: "failed"
 
-      visit admin_builds_path
+      visit ci_admin_builds_path
 
       within ".nav.nav-tabs" do
         click_on "Running"
diff --git a/spec/features/ci/admin/events_spec.rb b/spec/features/ci/admin/events_spec.rb
index 4f5dbd9fb6b75c7d86d0f4d949d17a970e846418..6b6ace06c53dc45148446033c0dd25e795454711 100644
--- a/spec/features/ci/admin/events_spec.rb
+++ b/spec/features/ci/admin/events_spec.rb
@@ -4,14 +4,14 @@ describe "Admin Events" do
   let(:event) { FactoryGirl.create :admin_event }
   
   before do
-    skip_admin_auth
+    skip_ci_admin_auth
     login_as :user
   end
 
   describe "GET /admin/events" do
     before do
       event
-      visit admin_events_path
+      visit ci_admin_events_path
     end
 
     it { expect(page).to have_content "Events" }
diff --git a/spec/features/ci/admin/projects_spec.rb b/spec/features/ci/admin/projects_spec.rb
index 9113300077dba00bf9a7ae47fda535e6721a53bd..b88f55a680700448e64fab3b9351ba6db6edbdb2 100644
--- a/spec/features/ci/admin/projects_spec.rb
+++ b/spec/features/ci/admin/projects_spec.rb
@@ -1,17 +1,17 @@
 require 'spec_helper'
 
 describe "Admin Projects" do
-  let(:project) { FactoryGirl.create :project }
+  let(:project) { FactoryGirl.create :ci_project }
 
   before do
-    skip_admin_auth
+    skip_ci_admin_auth
     login_as :user
   end
 
   describe "GET /admin/projects" do
     before do
       project
-      visit admin_projects_path
+      visit ci_admin_projects_path
     end
 
     it { expect(page).to have_content "Projects" }
diff --git a/spec/features/ci/admin/runners_spec.rb b/spec/features/ci/admin/runners_spec.rb
index fa3beb7b915572228dbf582bceed444971d64349..644d48ac29806a0dd62eb290fc15e22e36ecb186 100644
--- a/spec/features/ci/admin/runners_spec.rb
+++ b/spec/features/ci/admin/runners_spec.rb
@@ -2,16 +2,16 @@ require 'spec_helper'
 
 describe "Admin Runners" do
   before do
-    skip_admin_auth
+    skip_ci_admin_auth
     login_as :user
   end
 
   describe "Runners page" do
     before do
-      runner = FactoryGirl.create(:runner)
-      commit = FactoryGirl.create(:commit)
-      FactoryGirl.create(:build, commit: commit, runner_id: runner.id)
-      visit admin_runners_path
+      runner = FactoryGirl.create(:ci_runner)
+      commit = FactoryGirl.create(:ci_commit)
+      FactoryGirl.create(:ci_build, commit: commit, runner_id: runner.id)
+      visit ci_admin_runners_path
     end
 
     it { page.has_text? "Manage Runners" }
@@ -20,8 +20,8 @@ describe "Admin Runners" do
 
     describe 'search' do
       before do
-        FactoryGirl.create :runner, description: 'foo'
-        FactoryGirl.create :runner, description: 'bar'
+        FactoryGirl.create :ci_runner, description: 'foo'
+        FactoryGirl.create :ci_runner, description: 'bar'
 
         fill_in 'search', with: 'foo'
         click_button 'Search'
@@ -33,12 +33,12 @@ describe "Admin Runners" do
   end
 
   describe "Runner show page" do
-    let(:runner) { FactoryGirl.create :runner }
+    let(:runner) { FactoryGirl.create :ci_runner }
 
     before do
-      FactoryGirl.create(:project, name: "foo")
-      FactoryGirl.create(:project, name: "bar")
-      visit admin_runner_path(runner)
+      FactoryGirl.create(:ci_project, name: "foo")
+      FactoryGirl.create(:ci_project, name: "bar")
+      visit ci_admin_runner_path(runner)
     end
 
     describe 'runner info' do
diff --git a/spec/features/ci/events_spec.rb b/spec/features/ci/events_spec.rb
index d1bcf493eaa2829394592ced614bb803abb8ab06..dd13d7d66dc9d3179cb7b0d9109b4e6e4a1df101 100644
--- a/spec/features/ci/events_spec.rb
+++ b/spec/features/ci/events_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 describe "Events" do
-  let(:project) { FactoryGirl.create :project }
+  let(:project) { FactoryGirl.create :ci_project }
   let(:event) { FactoryGirl.create :admin_event, project: project }
   
   before do
@@ -11,7 +11,7 @@ describe "Events" do
   describe "GET /project/:id/events" do
     before do
       event
-      visit project_events_path(project)
+      visit ci_project_events_path(project)
     end
 
     it { expect(page).to have_content "Events" }
diff --git a/spec/features/ci/lint_spec.rb b/spec/features/ci/lint_spec.rb
index 820ed5b4716cddbf473c7a4990420277db0495c6..5d8f56e2cfb160bac8f81f0e6a41e276d0a7713a 100644
--- a/spec/features/ci/lint_spec.rb
+++ b/spec/features/ci/lint_spec.rb
@@ -7,7 +7,7 @@ describe "Lint" do
 
   it "Yaml parsing", js: true do
     content = File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))
-    visit lint_path 
+    visit ci_lint_path 
     fill_in "content", with: content
     click_on "Validate"
     within "table" do
@@ -19,7 +19,7 @@ describe "Lint" do
   end
 
   it "Yaml parsing with error", js: true do
-    visit lint_path
+    visit ci_lint_path
     fill_in "content", with: ""
     click_on "Validate"
     expect(page).to have_content("Status: syntax is incorrect")
diff --git a/spec/features/ci/runners_spec.rb b/spec/features/ci/runners_spec.rb
index 8eea0c4441fdce7cf2730838cb0498858c7bf4d2..86ccac29c74f4af0127df5861665b811259ff118 100644
--- a/spec/features/ci/runners_spec.rb
+++ b/spec/features/ci/runners_spec.rb
@@ -7,8 +7,8 @@ describe "Runners" do
 
   describe "specific runners" do
     before do
-      @project = FactoryGirl.create :project
-      @project2 = FactoryGirl.create :project
+      @project = FactoryGirl.create :ci_project
+      @project2 = FactoryGirl.create :ci_project
       stub_js_gitlab_calls
 
       # all projects should be authorized for user
@@ -17,22 +17,22 @@ describe "Runners" do
         OpenStruct.new({ id: @project2.gitlab_id })
       ])
 
-      @shared_runner = FactoryGirl.create :shared_runner
-      @specific_runner = FactoryGirl.create :specific_runner
-      @specific_runner2 = FactoryGirl.create :specific_runner
+      @shared_runner = FactoryGirl.create :ci_shared_runner
+      @specific_runner = FactoryGirl.create :ci_specific_runner
+      @specific_runner2 = FactoryGirl.create :ci_specific_runner
       @project.runners << @specific_runner
       @project2.runners << @specific_runner2
     end
 
     it "places runners in right places" do
-      visit project_runners_path(@project)
+      visit ci_project_runners_path(@project)
       expect(page.find(".available-specific-runners")).to have_content(@specific_runner2.display_name)
       expect(page.find(".activated-specific-runners")).to have_content(@specific_runner.display_name)
       expect(page.find(".available-shared-runners")).to have_content(@shared_runner.display_name)
     end
 
     it "enables specific runner for project" do
-      visit project_runners_path(@project)
+      visit ci_project_runners_path(@project)
 
       within ".available-specific-runners" do
         click_on "Enable for this project"
@@ -44,7 +44,7 @@ describe "Runners" do
     it "disables specific runner for project" do
       @project2.runners << @specific_runner
 
-      visit project_runners_path(@project)
+      visit ci_project_runners_path(@project)
 
       within ".activated-specific-runners" do
         click_on "Disable for this project"
@@ -54,7 +54,7 @@ describe "Runners" do
     end
 
     it "removes specific runner for project if this is last project for that runners" do
-      visit project_runners_path(@project)
+      visit ci_project_runners_path(@project)
 
       within ".activated-specific-runners" do
         click_on "Remove runner"
@@ -66,12 +66,12 @@ describe "Runners" do
 
   describe "shared runners" do
     before do
-      @project = FactoryGirl.create :project
+      @project = FactoryGirl.create :ci_project
       stub_js_gitlab_calls
     end
 
     it "enables shared runners" do
-      visit project_runners_path(@project)
+      visit ci_project_runners_path(@project)
 
       click_on "Enable shared runners"
 
@@ -81,14 +81,14 @@ describe "Runners" do
 
   describe "show page" do
     before do
-      @project = FactoryGirl.create :project
+      @project = FactoryGirl.create :ci_project
       stub_js_gitlab_calls
-      @specific_runner = FactoryGirl.create :specific_runner
+      @specific_runner = FactoryGirl.create :ci_specific_runner
       @project.runners << @specific_runner
     end
 
     it "shows runner information" do
-      visit project_runners_path(@project)
+      visit ci_project_runners_path(@project)
 
       click_on @specific_runner.short_sha
 
diff --git a/spec/features/ci/triggers_spec.rb b/spec/features/ci/triggers_spec.rb
index 39ef67578fbb368bed0eecc3acb0cf6543ef84d7..c65bea9dbcfc6c308e688b0795d040a4c1056bbd 100644
--- a/spec/features/ci/triggers_spec.rb
+++ b/spec/features/ci/triggers_spec.rb
@@ -1,11 +1,11 @@
 require 'spec_helper'
 
-describe 'Variables' do
+describe 'Triggers' do
   before do
     login_as :user
-    @project = FactoryGirl.create :project
+    @project = FactoryGirl.create :ci_project
     stub_js_gitlab_calls
-    visit project_triggers_path(@project)
+    visit ci_project_triggers_path(@project)
   end
 
   context 'create a trigger' do
diff --git a/spec/features/ci/variables_spec.rb b/spec/features/ci/variables_spec.rb
index 2e75c9fa1a7bdbfeaf39f1fb9e84e6ac90665ff8..84d6bfa0f32a559f2da99bf86a687da1702a746c 100644
--- a/spec/features/ci/variables_spec.rb
+++ b/spec/features/ci/variables_spec.rb
@@ -7,12 +7,12 @@ describe "Variables" do
 
   describe "specific runners" do
     before do
-      @project = FactoryGirl.create :project
+      @project = FactoryGirl.create :ci_project
       stub_js_gitlab_calls
     end
 
     it "creates variable", js: true do
-      visit project_variables_path(@project)
+      visit ci_project_variables_path(@project)
       click_on "Add a variable"
       fill_in "Key", with: "SECRET_KEY"
       fill_in "Value", with: "SECRET_VALUE"
diff --git a/spec/lib/ci/charts_spec.rb b/spec/lib/ci/charts_spec.rb
index 236cfc2a1f60bb053c6675eac5b9936937d1570b..24894e8198380661b25750032988acb1efa2015d 100644
--- a/spec/lib/ci/charts_spec.rb
+++ b/spec/lib/ci/charts_spec.rb
@@ -4,14 +4,14 @@ describe "Charts" do
 
   context "build_times" do
     before do
-      @project = FactoryGirl.create(:project)
-      @commit = FactoryGirl.create(:commit, project: @project)
-      FactoryGirl.create(:build, commit: @commit)
+      @project = FactoryGirl.create(:ci_project)
+      @commit = FactoryGirl.create(:ci_commit, project: @project)
+      FactoryGirl.create(:ci_build, commit: @commit)
     end
 
     it 'should return build times in minutes' do
-      chart = Charts::BuildTime.new(@project)
-      chart.build_times.should == [2]
+      chart = Ci::Charts::BuildTime.new(@project)
+      expect(chart.build_times).to eq([2])
     end
   end
 end
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index b60b4505145e39253799e17e8a65b258be7553cc..49482ac2b12c2fb5e8a7d7e24c17996af589e761 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -1,311 +1,313 @@
 require 'spec_helper'
 
-describe Ci::GitlabCiYamlProcessor do
-
-  describe "#builds_for_ref" do
-    let(:type) { 'test' }
-
-    it "returns builds if no branch specified" do
-      config = YAML.dump({
-        before_script: ["pwd"],
-        rspec: { script: "rspec" }
-      })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref(type, "master").size.should == 1
-      config_processor.builds_for_stage_and_ref(type, "master").first.should == {
-        stage: "test",
-        except: nil,
-        name: :rspec,
-        only: nil,
-        script: "pwd\nrspec",
-        tags: [],
-        options: {},
-        allow_failure: false
-      }
+module Ci
+  describe GitlabCiYamlProcessor do
+
+    describe "#builds_for_ref" do
+      let(:type) { 'test' }
+
+      it "returns builds if no branch specified" do
+        config = YAML.dump({
+          before_script: ["pwd"],
+          rspec: { script: "rspec" }
+        })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref(type, "master").size).to eq(1)
+        expect(config_processor.builds_for_stage_and_ref(type, "master").first).to eq({
+          stage: "test",
+          except: nil,
+          name: :rspec,
+          only: nil,
+          script: "pwd\nrspec",
+          tags: [],
+          options: {},
+          allow_failure: false
+        })
+      end
+
+      it "does not return builds if only has another branch" do
+        config = YAML.dump({
+          before_script: ["pwd"],
+          rspec: { script: "rspec", only: ["deploy"] }
+        })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref(type, "master").size).to eq(0)
+      end
+
+      it "does not return builds if only has regexp with another branch" do
+        config = YAML.dump({
+          before_script: ["pwd"],
+          rspec: { script: "rspec", only: ["/^deploy$/"] }
+        })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref(type, "master").size).to eq(0)
+      end
+
+      it "returns builds if only has specified this branch" do
+        config = YAML.dump({
+          before_script: ["pwd"],
+          rspec: { script: "rspec", only: ["master"] }
+        })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref(type, "master").size).to eq(1)
+      end
+
+      it "does not build tags" do
+        config = YAML.dump({
+          before_script: ["pwd"],
+          rspec: { script: "rspec", except: ["tags"] }
+        })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref(type, "0-1", true).size).to eq(0)
+      end
+
+      it "returns builds if only has a list of branches including specified" do
+        config = YAML.dump({
+                             before_script: ["pwd"],
+                             rspec: { script: "rspec", type: type, only: ["master", "deploy"] }
+                           })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(1)
+      end
+
+      it "returns build only for specified type" do
+
+        config = YAML.dump({
+                             before_script: ["pwd"],
+                             build: { script: "build", type: "build", only: ["master", "deploy"] },
+                             rspec: { script: "rspec", type: type, only: ["master", "deploy"] },
+                             staging: { script: "deploy", type: "deploy", only: ["master", "deploy"] },
+                             production: { script: "deploy", type: "deploy", only: ["master", "deploy"] },
+                           })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref("production", "deploy").size).to eq(0)
+        expect(config_processor.builds_for_stage_and_ref(type, "deploy").size).to eq(1)
+        expect(config_processor.builds_for_stage_and_ref("deploy", "deploy").size).to eq(2)
+      end
     end
 
-    it "does not return builds if only has another branch" do
-      config = YAML.dump({
-        before_script: ["pwd"],
-        rspec: { script: "rspec", only: ["deploy"] }
-      })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref(type, "master").size.should == 0
-    end
-
-    it "does not return builds if only has regexp with another branch" do
-      config = YAML.dump({
-        before_script: ["pwd"],
-        rspec: { script: "rspec", only: ["/^deploy$/"] }
-      })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref(type, "master").size.should == 0
-    end
-
-    it "returns builds if only has specified this branch" do
-      config = YAML.dump({
-        before_script: ["pwd"],
-        rspec: { script: "rspec", only: ["master"] }
-      })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref(type, "master").size.should == 1
-    end
-
-    it "does not build tags" do
-      config = YAML.dump({
-        before_script: ["pwd"],
-        rspec: { script: "rspec", except: ["tags"] }
-      })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref(type, "0-1", true).size.should == 0
-    end
-
-    it "returns builds if only has a list of branches including specified" do
-      config = YAML.dump({
-                           before_script: ["pwd"],
-                           rspec: { script: "rspec", type: type, only: ["master", "deploy"] }
-                         })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref(type, "deploy").size.should == 1
-    end
-
-    it "returns build only for specified type" do
-
-      config = YAML.dump({
-                           before_script: ["pwd"],
-                           build: { script: "build", type: "build", only: ["master", "deploy"] },
-                           rspec: { script: "rspec", type: type, only: ["master", "deploy"] },
-                           staging: { script: "deploy", type: "deploy", only: ["master", "deploy"] },
-                           production: { script: "deploy", type: "deploy", only: ["master", "deploy"] },
-                         })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref("production", "deploy").size.should == 0
-      config_processor.builds_for_stage_and_ref(type, "deploy").size.should == 1
-      config_processor.builds_for_stage_and_ref("deploy", "deploy").size.should == 2
-    end
-  end
-
-  describe "Image and service handling" do
-    it "returns image and service when defined" do
-      config = YAML.dump({
-                           image: "ruby:2.1",
-                           services: ["mysql"],
-                           before_script: ["pwd"],
-                           rspec: { script: "rspec" }
-                         })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref("test", "master").size.should == 1
-      config_processor.builds_for_stage_and_ref("test", "master").first.should == {
-        except: nil,
-        stage: "test",
-        name: :rspec,
-        only: nil,
-        script: "pwd\nrspec",
-        tags: [],
-        options: {
-          image: "ruby:2.1",
-          services: ["mysql"]
-        },
-        allow_failure: false
-      }
-    end
-
-    it "returns image and service when overridden for job" do
-      config = YAML.dump({
-                           image:         "ruby:2.1",
-                           services:      ["mysql"],
-                           before_script: ["pwd"],
-                           rspec:         { image: "ruby:2.5", services: ["postgresql"], script: "rspec" }
-                         })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-
-      config_processor.builds_for_stage_and_ref("test", "master").size.should == 1
-      config_processor.builds_for_stage_and_ref("test", "master").first.should == {
-        except: nil,
-        stage: "test",
-        name: :rspec,
-        only: nil,
-        script: "pwd\nrspec",
-        tags: [],
-        options: {
-          image: "ruby:2.5",
-          services: ["postgresql"]
-        },
-        allow_failure: false
-      }
-    end
-  end
-
-  describe "Variables" do
-    it "returns variables when defined" do
-      variables = {
-        var1: "value1",
-        var2: "value2",
-      }
-      config = YAML.dump({
-                           variables: variables,
-                           before_script: ["pwd"],
-                           rspec: { script: "rspec" }
-                         })
-
-      config_processor = GitlabCiYamlProcessor.new(config)
-      config_processor.variables.should == variables
-    end
-  end
-
-  describe "Error handling" do
-    it "indicates that object is invalid" do
-      expect{GitlabCiYamlProcessor.new("invalid_yaml\n!ccdvlf%612334@@@@")}.to raise_error(GitlabCiYamlProcessor::ValidationError)
-    end
-
-    it "returns errors if tags parameter is invalid" do
-      config = YAML.dump({ rspec: { script: "test", tags: "mysql" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: tags parameter should be an array of strings")
-    end
-
-    it "returns errors if before_script parameter is invalid" do
-      config = YAML.dump({ before_script: "bundle update", rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "before_script should be an array of strings")
-    end
-
-    it "returns errors if image parameter is invalid" do
-      config = YAML.dump({ image: ["test"], rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "image should be a string")
-    end
-
-    it "returns errors if job image parameter is invalid" do
-      config = YAML.dump({ rspec: { script: "test", image: ["test"] } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: image should be a string")
-    end
-
-    it "returns errors if services parameter is not an array" do
-      config = YAML.dump({ services: "test", rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "services should be an array of strings")
-    end
-
-    it "returns errors if services parameter is not an array of strings" do
-      config = YAML.dump({ services: [10, "test"], rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "services should be an array of strings")
-    end
-
-    it "returns errors if job services parameter is not an array" do
-      config = YAML.dump({ rspec: { script: "test", services: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: services should be an array of strings")
-    end
-
-    it "returns errors if job services parameter is not an array of strings" do
-      config = YAML.dump({ rspec: { script: "test", services: [10, "test"] } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: services should be an array of strings")
-    end
-
-    it "returns errors if there are unknown parameters" do
-      config = YAML.dump({ extra: "bundle update" })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "Unknown parameter: extra")
-    end
-
-    it "returns errors if there are unknown parameters that are hashes, but doesn't have a script" do
-      config = YAML.dump({ extra: { services: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "Unknown parameter: extra")
-    end
-
-    it "returns errors if there is no any jobs defined" do
-      config = YAML.dump({ before_script: ["bundle update"] })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "Please define at least one job")
-    end
-
-    it "returns errors if job allow_failure parameter is not an boolean" do
-      config = YAML.dump({ rspec: { script: "test", allow_failure: "string" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: allow_failure parameter should be an boolean")
-    end
-
-    it "returns errors if job stage is not a string" do
-      config = YAML.dump({ rspec: { script: "test", type: 1, allow_failure: "string" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: stage parameter should be build, test, deploy")
-    end
-
-    it "returns errors if job stage is not a pre-defined stage" do
-      config = YAML.dump({ rspec: { script: "test", type: "acceptance", allow_failure: "string" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: stage parameter should be build, test, deploy")
-    end
-
-    it "returns errors if job stage is not a defined stage" do
-      config = YAML.dump({ types: ["build", "test"], rspec: { script: "test", type: "acceptance", allow_failure: "string" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: stage parameter should be build, test")
-    end
-
-    it "returns errors if stages is not an array" do
-      config = YAML.dump({ types: "test", rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "stages should be an array of strings")
-    end
-
-    it "returns errors if stages is not an array of strings" do
-      config = YAML.dump({ types: [true, "test"], rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "stages should be an array of strings")
+    describe "Image and service handling" do
+      it "returns image and service when defined" do
+        config = YAML.dump({
+                             image: "ruby:2.1",
+                             services: ["mysql"],
+                             before_script: ["pwd"],
+                             rspec: { script: "rspec" }
+                           })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref("test", "master").size).to eq(1)
+        expect(config_processor.builds_for_stage_and_ref("test", "master").first).to eq({
+          except: nil,
+          stage: "test",
+          name: :rspec,
+          only: nil,
+          script: "pwd\nrspec",
+          tags: [],
+          options: {
+            image: "ruby:2.1",
+            services: ["mysql"]
+          },
+          allow_failure: false
+        })
+      end
+
+      it "returns image and service when overridden for job" do
+        config = YAML.dump({
+                             image:         "ruby:2.1",
+                             services:      ["mysql"],
+                             before_script: ["pwd"],
+                             rspec:         { image: "ruby:2.5", services: ["postgresql"], script: "rspec" }
+                           })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+
+        expect(config_processor.builds_for_stage_and_ref("test", "master").size).to eq(1)
+        expect(config_processor.builds_for_stage_and_ref("test", "master").first).to eq({
+          except: nil,
+          stage: "test",
+          name: :rspec,
+          only: nil,
+          script: "pwd\nrspec",
+          tags: [],
+          options: {
+            image: "ruby:2.5",
+            services: ["postgresql"]
+          },
+          allow_failure: false
+        })
+      end
     end
 
-    it "returns errors if variables is not a map" do
-      config = YAML.dump({ variables: "test", rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "variables should be a map of key-valued strings")
+    describe "Variables" do
+      it "returns variables when defined" do
+        variables = {
+          var1: "value1",
+          var2: "value2",
+        }
+        config = YAML.dump({
+                             variables: variables,
+                             before_script: ["pwd"],
+                             rspec: { script: "rspec" }
+                           })
+
+        config_processor = GitlabCiYamlProcessor.new(config)
+        expect(config_processor.variables).to eq(variables)
+      end
     end
 
-    it "returns errors if variables is not a map of key-valued strings" do
-      config = YAML.dump({ variables: { test: false }, rspec: { script: "test" } })
-      expect do
-        GitlabCiYamlProcessor.new(config)
-      end.to raise_error(GitlabCiYamlProcessor::ValidationError, "variables should be a map of key-valued strings")
+    describe "Error handling" do
+      it "indicates that object is invalid" do
+        expect{GitlabCiYamlProcessor.new("invalid_yaml\n!ccdvlf%612334@@@@")}.to raise_error(GitlabCiYamlProcessor::ValidationError)
+      end
+
+      it "returns errors if tags parameter is invalid" do
+        config = YAML.dump({ rspec: { script: "test", tags: "mysql" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: tags parameter should be an array of strings")
+      end
+
+      it "returns errors if before_script parameter is invalid" do
+        config = YAML.dump({ before_script: "bundle update", rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "before_script should be an array of strings")
+      end
+
+      it "returns errors if image parameter is invalid" do
+        config = YAML.dump({ image: ["test"], rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "image should be a string")
+      end
+
+      it "returns errors if job image parameter is invalid" do
+        config = YAML.dump({ rspec: { script: "test", image: ["test"] } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: image should be a string")
+      end
+
+      it "returns errors if services parameter is not an array" do
+        config = YAML.dump({ services: "test", rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "services should be an array of strings")
+      end
+
+      it "returns errors if services parameter is not an array of strings" do
+        config = YAML.dump({ services: [10, "test"], rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "services should be an array of strings")
+      end
+
+      it "returns errors if job services parameter is not an array" do
+        config = YAML.dump({ rspec: { script: "test", services: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: services should be an array of strings")
+      end
+
+      it "returns errors if job services parameter is not an array of strings" do
+        config = YAML.dump({ rspec: { script: "test", services: [10, "test"] } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: services should be an array of strings")
+      end
+
+      it "returns errors if there are unknown parameters" do
+        config = YAML.dump({ extra: "bundle update" })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "Unknown parameter: extra")
+      end
+
+      it "returns errors if there are unknown parameters that are hashes, but doesn't have a script" do
+        config = YAML.dump({ extra: { services: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "Unknown parameter: extra")
+      end
+
+      it "returns errors if there is no any jobs defined" do
+        config = YAML.dump({ before_script: ["bundle update"] })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "Please define at least one job")
+      end
+
+      it "returns errors if job allow_failure parameter is not an boolean" do
+        config = YAML.dump({ rspec: { script: "test", allow_failure: "string" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: allow_failure parameter should be an boolean")
+      end
+
+      it "returns errors if job stage is not a string" do
+        config = YAML.dump({ rspec: { script: "test", type: 1, allow_failure: "string" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: stage parameter should be build, test, deploy")
+      end
+
+      it "returns errors if job stage is not a pre-defined stage" do
+        config = YAML.dump({ rspec: { script: "test", type: "acceptance", allow_failure: "string" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: stage parameter should be build, test, deploy")
+      end
+
+      it "returns errors if job stage is not a defined stage" do
+        config = YAML.dump({ types: ["build", "test"], rspec: { script: "test", type: "acceptance", allow_failure: "string" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "rspec job: stage parameter should be build, test")
+      end
+
+      it "returns errors if stages is not an array" do
+        config = YAML.dump({ types: "test", rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "stages should be an array of strings")
+      end
+
+      it "returns errors if stages is not an array of strings" do
+        config = YAML.dump({ types: [true, "test"], rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "stages should be an array of strings")
+      end
+
+      it "returns errors if variables is not a map" do
+        config = YAML.dump({ variables: "test", rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "variables should be a map of key-valued strings")
+      end
+
+      it "returns errors if variables is not a map of key-valued strings" do
+        config = YAML.dump({ variables: { test: false }, rspec: { script: "test" } })
+        expect do
+          GitlabCiYamlProcessor.new(config)
+        end.to raise_error(GitlabCiYamlProcessor::ValidationError, "variables should be a map of key-valued strings")
+      end
     end
   end
 end
diff --git a/spec/models/ci/mail_service_spec.rb b/spec/models/ci/mail_service_spec.rb
index 51511641afcf1913f100a372caa6eb1e9d4b8fd5..564c2941bb5365df7633c3a8b9d36ca6cefc7dd5 100644
--- a/spec/models/ci/mail_service_spec.rb
+++ b/spec/models/ci/mail_service_spec.rb
@@ -169,7 +169,7 @@ describe Ci::MailService do
       end
 
       it do
-        Build.retry(build)
+        Ci::Build.retry(build)
         should_email(commit.git_author_email)
         should_email("jeroen@example.com")
         mail.execute(build) if mail.can_execute?(build)
diff --git a/spec/models/ci/project_services/slack_message_spec.rb b/spec/models/ci/project_services/slack_message_spec.rb
index ef0714909d5cf1cc620cf0a00cca6c8eb8944a29..f533590372851716be6f063bbe00b925f558532f 100644
--- a/spec/models/ci/project_services/slack_message_spec.rb
+++ b/spec/models/ci/project_services/slack_message_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 describe Ci::SlackMessage do
-  subject { SlackMessage.new(commit) }
+  subject { Ci::SlackMessage.new(commit) }
 
   let(:project) { FactoryGirl.create :ci_project }
 
@@ -43,7 +43,7 @@ describe Ci::SlackMessage do
   end
 
   context "Several builds" do
-    let(:commit) { FactoryGirl.create(:commit_with_two_jobs, project: project) }
+    let(:commit) { FactoryGirl.create(:ci_commit_with_two_jobs, project: project) }
 
     context 'when all matrix builds succeeded' do
       let(:color) { 'good' }
diff --git a/spec/models/ci/project_services/slack_service_spec.rb b/spec/models/ci/project_services/slack_service_spec.rb
index ae577adfb754875289746ae998401fc843ff26de..0524f4724327d7f842f5226d411cb087b46e86b1 100644
--- a/spec/models/ci/project_services/slack_service_spec.rb
+++ b/spec/models/ci/project_services/slack_service_spec.rb
@@ -30,7 +30,7 @@ describe Ci::SlackService do
   end
 
   describe "Execute" do
-    let(:slack)   { SlackService.new }
+    let(:slack)   { Ci::SlackService.new }
     let(:project) { FactoryGirl.create :ci_project }
     let(:commit)  { FactoryGirl.create :ci_commit, project: project }
     let(:build)   { FactoryGirl.create :ci_build, commit: commit, status: 'failed' }
@@ -50,7 +50,7 @@ describe Ci::SlackService do
 
     it "should call Slack API" do
       slack.execute(build)
-      SlackNotifierWorker.drain
+      Ci::SlackNotifierWorker.drain
 
       expect(WebMock).to have_requested(:post, webhook_url).once
     end
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb
index c6130b69964da5c43f094da9895d44159e170e85..757593a7ab8f090b80f9ad63cd8a926f84c5ae03 100644
--- a/spec/models/ci/runner_spec.rb
+++ b/spec/models/ci/runner_spec.rb
@@ -22,7 +22,7 @@ require 'spec_helper'
 describe Ci::Runner do
   describe '#display_name' do
     it 'should return the description if it has a value' do
-      runner = FactoryGirl.build(:runner, description: 'Linux/Ruby-1.9.3-p448')
+      runner = FactoryGirl.build(:ci_runner, description: 'Linux/Ruby-1.9.3-p448')
       expect(runner.display_name).to eq 'Linux/Ruby-1.9.3-p448'
     end
 
@@ -32,7 +32,7 @@ describe Ci::Runner do
     end
 
     it 'should return the token if the description is an empty string' do
-      runner = FactoryGirl.build(:runner, description: '')
+      runner = FactoryGirl.build(:ci_runner, description: '')
       expect(runner.display_name).to eq runner.token
     end
   end
diff --git a/spec/models/ci/service_spec.rb b/spec/models/ci/service_spec.rb
index 04807a705eb0a1b487662fec8283bf8c1338fb88..2c575056b087bdc692aaf18241da29eb5219f2b4 100644
--- a/spec/models/ci/service_spec.rb
+++ b/spec/models/ci/service_spec.rb
@@ -25,7 +25,7 @@ describe Ci::Service do
 
   describe "Test Button" do
     before do
-      @service = Service.new
+      @service = Ci::Service.new
     end
 
     describe "Testable" do
diff --git a/spec/services/ci/create_project_service_spec.rb b/spec/services/ci/create_project_service_spec.rb
index 234a778f8cce931024e6c9ae60465bbaed9d71b4..ce5b131f192d1a0f5d69d4b243162127c09a38fb 100644
--- a/spec/services/ci/create_project_service_spec.rb
+++ b/spec/services/ci/create_project_service_spec.rb
@@ -1,12 +1,10 @@
 require 'spec_helper'
 
 describe Ci::CreateProjectService do
-  let(:service) { CreateProjectService.new }
+  let(:service) { Ci::CreateProjectService.new }
   let(:current_user) { double.as_null_object }
   let(:project_dump) { YAML.load File.read(Rails.root.join('spec/support/gitlab_stubs/raw_project.yml')) }
 
-  before { allow_any_instance_of(Network).to receive_messages(enable_ci: true) }
-
   describe :execute do
     context 'valid params' do
       let(:project) { service.execute(current_user, project_dump, 'http://localhost/projects/:project_id') }
@@ -23,7 +21,7 @@ describe Ci::CreateProjectService do
 
     context "forking" do
       it "uses project as a template for settings and jobs" do
-        origin_project = FactoryGirl.create(:project)
+        origin_project = FactoryGirl.create(:ci_project)
         origin_project.shared_runners_enabled = true
         origin_project.public = true
         origin_project.allow_git_fetch = true
diff --git a/spec/services/ci/create_trigger_request_service_spec.rb b/spec/services/ci/create_trigger_request_service_spec.rb
index 9082c741eada441fc43d6dffbaf2ac7bf726db26..d12cd9773dce98bdfb36c906b0ee6cb3dae23ea6 100644
--- a/spec/services/ci/create_trigger_request_service_spec.rb
+++ b/spec/services/ci/create_trigger_request_service_spec.rb
@@ -1,19 +1,19 @@
 require 'spec_helper'
 
 describe Ci::CreateTriggerRequestService do
-  let(:service) { CreateTriggerRequestService.new }
-  let(:project) { FactoryGirl.create :project }
-  let(:trigger) { FactoryGirl.create :trigger, project: project }
+  let(:service) { Ci::CreateTriggerRequestService.new }
+  let(:project) { FactoryGirl.create :ci_project }
+  let(:trigger) { FactoryGirl.create :ci_trigger, project: project }
 
   describe :execute do
     context 'valid params' do
       subject { service.execute(project, trigger, 'master') }
 
       before do
-        @commit = FactoryGirl.create :commit, project: project
+        @commit = FactoryGirl.create :ci_commit, project: project
       end
 
-      it { expect(subject).to be_kind_of(TriggerRequest) }
+      it { expect(subject).to be_kind_of(Ci::TriggerRequest) }
       it { expect(subject.commit).to eq(@commit) }
     end
 
@@ -27,7 +27,7 @@ describe Ci::CreateTriggerRequestService do
       subject { service.execute(project, trigger, 'master') }
 
       before do
-        FactoryGirl.create :commit_without_jobs, project: project
+        FactoryGirl.create :ci_commit_without_jobs, project: project
       end
 
       it { expect(subject).to be_nil }
@@ -37,13 +37,13 @@ describe Ci::CreateTriggerRequestService do
       subject { service.execute(project, trigger, 'master') }
 
       before do
-        @commit1 = FactoryGirl.create :commit, committed_at: 2.hour.ago, project: project
-        @commit2 = FactoryGirl.create :commit, committed_at: 1.hour.ago, project: project
-        @commit3 = FactoryGirl.create :commit, committed_at: 3.hour.ago, project: project
+        @commit1 = FactoryGirl.create :ci_commit, committed_at: 2.hour.ago, project: project
+        @commit2 = FactoryGirl.create :ci_commit, committed_at: 1.hour.ago, project: project
+        @commit3 = FactoryGirl.create :ci_commit, committed_at: 3.hour.ago, project: project
       end
 
       context 'retries latest one' do
-        it { expect(subject).to be_kind_of(TriggerRequest) }
+        it { expect(subject).to be_kind_of(Ci::TriggerRequest) }
         it { expect(subject).to be_persisted }
         it { expect(subject.commit).to eq(@commit2) }
       end
diff --git a/spec/services/ci/event_service_spec.rb b/spec/services/ci/event_service_spec.rb
index c8c4c45cc31f13e390ea8190059272c4b435ffb2..9b330a90ae29f4afec271cbc640ed99d9fe4fb0f 100644
--- a/spec/services/ci/event_service_spec.rb
+++ b/spec/services/ci/event_service_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 describe Ci::EventService do
-  let(:project) { FactoryGirl.create :project, name: "GitLab / gitlab-shell" }
+  let(:project) { FactoryGirl.create :ci_project, name: "GitLab / gitlab-shell" }
   let(:user)   { double(username: "root", id: 1) }
 
   before do
@@ -10,25 +10,25 @@ describe Ci::EventService do
 
   describe :remove_project do
     it "creates event" do
-      EventService.new.remove_project(user, project)
+      Ci::EventService.new.remove_project(user, project)
 
-      expect(Event.admin.last.description).to eq("Project \"GitLab / gitlab-shell\" has been removed by root")
+      expect(Ci::Event.admin.last.description).to eq("Project \"GitLab / gitlab-shell\" has been removed by root")
     end
   end
 
   describe :create_project do
     it "creates event" do
-      EventService.new.create_project(user, project)
+      Ci::EventService.new.create_project(user, project)
 
-      expect(Event.admin.last.description).to eq("Project \"GitLab / gitlab-shell\" has been created by root")
+      expect(Ci::Event.admin.last.description).to eq("Project \"GitLab / gitlab-shell\" has been created by root")
     end
   end
 
   describe :change_project_settings do
     it "creates event" do
-      EventService.new.change_project_settings(user, project)
+      Ci::EventService.new.change_project_settings(user, project)
 
-      expect(Event.last.description).to eq("User \"root\" updated projects settings")
+      expect(Ci::Event.last.description).to eq("User \"root\" updated projects settings")
     end
   end
 end
diff --git a/spec/services/ci/web_hook_service_spec.rb b/spec/services/ci/web_hook_service_spec.rb
index b893b1f23f2b65b6cc930118d60045fcd43dadc7..cebdd145e40a948179f85927b432f45bfe8fd27a 100644
--- a/spec/services/ci/web_hook_service_spec.rb
+++ b/spec/services/ci/web_hook_service_spec.rb
@@ -1,15 +1,15 @@
 require 'spec_helper'
 
 describe Ci::WebHookService do
-  let(:project) { FactoryGirl.create :project }
-  let(:commit)  { FactoryGirl.create :commit, project: project }
-  let(:build)   { FactoryGirl.create :build, commit: commit }
-  let(:hook)    { FactoryGirl.create :web_hook, project: project }
+  let(:project) { FactoryGirl.create :ci_project }
+  let(:commit)  { FactoryGirl.create :ci_commit, project: project }
+  let(:build)   { FactoryGirl.create :ci_build, commit: commit }
+  let(:hook)    { FactoryGirl.create :ci_web_hook, project: project }
 
   describe :execute do
     it "should execute successfully" do
       stub_request(:post, hook.url).to_return(status: 200)
-      expect(WebHookService.new.build_end(build)).to be_truthy
+      expect(Ci::WebHookService.new.build_end(build)).to be_truthy
     end
   end
 
@@ -31,6 +31,6 @@ describe Ci::WebHookService do
   end
 
   def build_data(build)
-    WebHookService.new.send :build_data, build
+    Ci::WebHookService.new.send :build_data, build
   end
 end
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb
index ffe30a4246c5ed8a49571b8fbf2245e8216b2b4d..cd9fdc6f18ee051dd3b8c7491759aaa548fdc28c 100644
--- a/spec/support/login_helpers.rb
+++ b/spec/support/login_helpers.rb
@@ -44,4 +44,8 @@ module LoginHelpers
   def logout_direct
     page.driver.submit :delete, '/users/sign_out', {}
   end
+
+  def skip_ci_admin_auth
+    allow_any_instance_of(Ci::Admin::ApplicationController).to receive_messages(authenticate_admin!: true)
+  end
 end