From 10e732d2bb1afff22a0549c74636641859cc3bde Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 27 Jun 2017 17:46:45 +0800 Subject: Rename instead of delete, feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12363#note_33449374 --- spec/migrations/remove_duplicated_variable_spec.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'spec/migrations') diff --git a/spec/migrations/remove_duplicated_variable_spec.rb b/spec/migrations/remove_duplicated_variable_spec.rb index 9a521a7d980..11096564dfa 100644 --- a/spec/migrations/remove_duplicated_variable_spec.rb +++ b/spec/migrations/remove_duplicated_variable_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' -require Rails.root.join('db', 'migrate', '20170622135451_remove_duplicated_variable.rb') +require Rails.root.join('db', 'migrate', '20170622135451_rename_duplicated_variable_key.rb') -describe RemoveDuplicatedVariable, :migration do +describe RenameDuplicatedVariableKey, :migration do let(:variables) { table(:ci_variables) } let(:projects) { table(:projects) } @@ -20,6 +20,15 @@ describe RemoveDuplicatedVariable, :migration do it 'correctly remove duplicated records with smaller id' do migrate! - expect(variables.pluck(:id)).to contain_exactly(1, 2, 6, 7, 8) + expect(variables.pluck(:id, :key)).to contain_exactly( + [1, 'key1'], + [2, 'key2'], + [3, 'keyX_3'], + [4, 'keyX_4'], + [5, 'keyY_5'], + [6, 'keyX'], + [7, 'key7'], + [8, 'keyY'] + ) end end -- cgit v1.2.1