summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-05-22 17:55:58 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-05-22 18:02:23 +0800
commit5d63a3939551116cd277ab4d32743146490a5e68 (patch)
tree16e554ea96141c84300c63560f33eb39c65f4fa4
parentb5918f222b603058c0773f067f7925e026932992 (diff)
downloadgitlab-ce-5d63a3939551116cd277ab4d32743146490a5e68.tar.gz
Add a test to ensure this works on MySQL
-rw-r--r--spec/migrations/update_retried_for_ci_builds_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/migrations/update_retried_for_ci_builds_spec.rb b/spec/migrations/update_retried_for_ci_builds_spec.rb
new file mode 100644
index 00000000000..5cdb8a3c7da
--- /dev/null
+++ b/spec/migrations/update_retried_for_ci_builds_spec.rb
@@ -0,0 +1,17 @@
+require 'spec_helper'
+require Rails.root.join('db', 'post_migrate', '20170503004427_upate_retried_for_ci_build.rb')
+
+describe UpateRetriedForCiBuild, truncate: true do
+ let(:pipeline) { create(:ci_pipeline) }
+ let!(:build_old) { create(:ci_build, pipeline: pipeline, name: 'test') }
+ let!(:build_new) { create(:ci_build, pipeline: pipeline, name: 'test') }
+
+ before do
+ described_class.new.up
+ end
+
+ it 'updates ci_builds.is_retried' do
+ expect(build_old.reload).to be_retried
+ expect(build_new.reload).not_to be_retried
+ end
+end