From 990bd06c04bebe6319968aa619990bf4cb60483c Mon Sep 17 00:00:00 2001
From: Tomasz Maczukin <tomasz@maczukin.pl>
Date: Wed, 13 Jan 2016 16:05:49 +0100
Subject: [PATCH] Change :ci_build_canceled factory to :canceled trait

---
 spec/factories/ci/builds.rb      | 8 ++++----
 spec/requests/api/builds_spec.rb | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb
index 558598d4d5c..636cdbba1b8 100644
--- a/spec/factories/ci/builds.rb
+++ b/spec/factories/ci/builds.rb
@@ -43,6 +43,10 @@ FactoryGirl.define do
 
     commit factory: :ci_commit
 
+    trait :canceled do
+      status 'canceled'
+    end
+
     after(:build) do |build, evaluator|
       build.project = build.commit.project
     end
@@ -62,9 +66,5 @@ FactoryGirl.define do
         build.trace = 'BUILD TRACE'
       end
     end
-
-    factory :ci_build_canceled do
-      status 'canceled'
-    end
   end
 end
diff --git a/spec/requests/api/builds_spec.rb b/spec/requests/api/builds_spec.rb
index 4bf3d2681dc..e5567d42500 100644
--- a/spec/requests/api/builds_spec.rb
+++ b/spec/requests/api/builds_spec.rb
@@ -11,7 +11,7 @@ describe API::API, api: true  do
   let(:commit) { create(:ci_commit, project: project)}
   let(:build) { create(:ci_build, commit: commit) }
   let(:build_with_trace) { create(:ci_build_with_trace, commit: commit) }
-  let(:build_canceled) { create(:ci_build_canceled, commit: commit) }
+  let(:build_canceled) { create(:ci_build, :canceled, commit: commit) }
 
   describe 'GET /projects/:id/builds ' do
     context 'authorized user' do
-- 
GitLab