summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-09-01 01:51:55 +0900
committerShinya Maeda <shinya@gitlab.com>2017-09-03 23:49:11 +0900
commit5547baa3eb1979e8de36f00174c1f98ddc3dabd0 (patch)
tree47c5ca6395c916a5206217a97683b37718693187
parentce7c0ac3dbdc3f2f2f34b39bf5ef3755e79e9d42 (diff)
downloadgitlab-ce-5547baa3eb1979e8de36f00174c1f98ddc3dabd0.tar.gz
Fix spec
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--spec/support/cycle_analytics_helpers.rb6
3 files changed, 6 insertions, 4 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 11717a1bb12..78fcfff3ea0 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -26,7 +26,7 @@ module Ci
validates :coverage, numericality: true, allow_blank: true
validates :ref, presence: true
- validates :protected, inclusion: { in: [ true, false ] }, on: :create
+ validates :protected, inclusion: { in: [true, false] }, on: :create
scope :unstarted, ->() { where(runner_id: nil) }
scope :ignore_failures, ->() { where(allow_failure: false) }
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index d877e51c2a7..ca9a350ea79 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -36,7 +36,7 @@ module Ci
validates :sha, presence: { unless: :importing? }
validates :ref, presence: { unless: :importing? }
validates :status, presence: { unless: :importing? }
- validates :protected, inclusion: { in: [ true, false ], unless: :importing? }, on: :create
+ validates :protected, inclusion: { in: [true, false], unless: :importing? }, on: :create
validate :valid_commit_sha, unless: :importing?
after_create :keep_around_commits, unless: :importing?
diff --git a/spec/support/cycle_analytics_helpers.rb b/spec/support/cycle_analytics_helpers.rb
index 39586d37e93..e6b66c4baed 100644
--- a/spec/support/cycle_analytics_helpers.rb
+++ b/spec/support/cycle_analytics_helpers.rb
@@ -80,7 +80,8 @@ module CycleAnalyticsHelpers
sha: project.repository.commit('master').sha,
ref: 'master',
source: :push,
- project: project)
+ project: project,
+ protected: true)
end
def new_dummy_job(environment)
@@ -93,7 +94,8 @@ module CycleAnalyticsHelpers
ref: 'master',
tag: false,
name: 'dummy',
- pipeline: dummy_pipeline)
+ pipeline: dummy_pipeline,
+ protected: true)
end
end