diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-04-05 22:10:52 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-04-05 22:10:52 +0300 |
commit | e258e6f1471fb176e39daf6fef7785af120c2178 (patch) | |
tree | 374873e6eebb747c4d19ec065f2f2fa49a86d0cb /app | |
parent | 6bf1780aa81a45afdf9ddbfc32c2b9f1e0ba9285 (diff) |
Add test for presenters
Diffstat (limited to 'app')
-rw-r--r-- | app/models/ci/pipeline.rb | 4 | ||||
-rw-r--r-- | app/presenters/ci/pipeline_presenter.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 9ef35ebdd50..8aad149519e 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -219,6 +219,10 @@ module Ci statuses.cancelable.any? end + def auto_canceled? + canceled? && auto_canceled_by_id? + end + def cancel_running Gitlab::OptimisticLocking.retry_lock( statuses.cancelable) do |cancelable| diff --git a/app/presenters/ci/pipeline_presenter.rb b/app/presenters/ci/pipeline_presenter.rb index 8f9e4fa707d..b8e74bf5509 100644 --- a/app/presenters/ci/pipeline_presenter.rb +++ b/app/presenters/ci/pipeline_presenter.rb @@ -2,10 +2,6 @@ module Ci class PipelinePresenter < Gitlab::View::Presenter::Delegated presents :pipeline - def auto_canceled? - canceled? && auto_canceled_by_id? - end - def status_title "Pipeline is redundant and is auto-canceled by Pipeline ##{auto_canceled_by_id}" if auto_canceled? end |