summaryrefslogtreecommitdiff
path: root/spec/migrations
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-11 12:01:35 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-11 12:05:04 +0200
commit1d087e073660130c81bf0917a6fa395886b6e2dc (patch)
treeb51ee85871f41c33804d3770e53047cd8d86315c /spec/migrations
parent6e9924a2245004c6b6adb34028880a46fd5471df (diff)
downloadgitlab-ce-1d087e073660130c81bf0917a6fa395886b6e2dc.tar.gz
Freeze mutable constants in stages migration code
Diffstat (limited to 'spec/migrations')
-rw-r--r--spec/migrations/migrate_stages_statuses_spec.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/migrations/migrate_stages_statuses_spec.rb b/spec/migrations/migrate_stages_statuses_spec.rb
index 1769b1e256b..7a424bdaedb 100644
--- a/spec/migrations/migrate_stages_statuses_spec.rb
+++ b/spec/migrations/migrate_stages_statuses_spec.rb
@@ -8,7 +8,7 @@ describe MigrateStagesStatuses, :migration do
let(:projects) { table(:projects) }
STATUSES = { created: 0, pending: 1, running: 2, success: 3,
- failed: 4, canceled: 5, skipped: 6, manual: 7 }
+ failed: 4, canceled: 5, skipped: 6, manual: 7 }.freeze
before do
stub_const("#{described_class.name}::BATCH_SIZE", 2)
@@ -59,9 +59,8 @@ describe MigrateStagesStatuses, :migration do
end
end
-
def create_job(project:, pipeline:, stage:, status:, **opts)
- stages = { test: 1, build: 2, deploy: 3}
+ stages = { test: 1, build: 2, deploy: 3 }
jobs.create!(project_id: project, commit_id: pipeline,
stage_idx: stages[stage.to_sym], stage: stage,