diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-03-30 18:59:45 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-03 02:11:51 +0900 |
commit | 0a36bfa994582b690a7935fed4c15d42b22bd0ed (patch) | |
tree | a3cc8fedbed53f6bfc5e30cfafc5df59100a73e3 /spec | |
parent | 4bd0d8e433cdffba9e28a24657104eb2b0b0e761 (diff) | |
download | gitlab-ce-0a36bfa994582b690a7935fed4c15d42b22bd0ed.tar.gz |
Use HasStatus::AVAILABLE_STATUSES instead of hard coding
Diffstat (limited to 'spec')
-rw-r--r-- | spec/finders/pipelines_finder_spec.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/pipelines_spec.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb index cffe5a46622..276a680b457 100644 --- a/spec/finders/pipelines_finder_spec.rb +++ b/spec/finders/pipelines_finder_spec.rb @@ -60,13 +60,13 @@ describe PipelinesFinder do end end - %w[running pending success failed canceled skipped].each do |target| + HasStatus::AVAILABLE_STATUSES.each do |target| context "when status is #{target}" do let(:params) { { status: target } } let!(:pipeline) { create(:ci_pipeline, project: project, status: target) } before do - exception_status = %w[running pending success failed canceled skipped] - [target] + exception_status = HasStatus::AVAILABLE_STATUSES - [target] create(:ci_pipeline, project: project, status: exception_status.sample) end diff --git a/spec/requests/api/pipelines_spec.rb b/spec/requests/api/pipelines_spec.rb index 6406b60219c..b7d61b2cd7c 100644 --- a/spec/requests/api/pipelines_spec.rb +++ b/spec/requests/api/pipelines_spec.rb @@ -95,11 +95,11 @@ describe API::Pipelines do end end - %w[running pending success failed canceled skipped].each do |target| + HasStatus::AVAILABLE_STATUSES.each do |target| context "when status is #{target}" do before do create(:ci_pipeline, project: project, status: target) - exception_status = %w[running pending success failed canceled skipped] - [target] + exception_status = HasStatus::AVAILABLE_STATUSES - [target] create(:ci_pipeline, project: project, status: exception_status.sample) end |