summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-01-30 12:26:49 +0100
committerJames Lopez <james@jameslopez.es>2017-01-30 12:34:32 +0100
commit1a2d13c821179a2707790d9c0e4585044462cd42 (patch)
tree45b3044bf8b7d76a757131c5260ed1cb107b6808 /spec
parenteeb13c16d1f627eba10313bf5c4662416392feb3 (diff)
downloadgitlab-ce-1a2d13c821179a2707790d9c0e4585044462cd42.tar.gz
programmatically remove encrypted attributes. Added relevant spec.
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/import_export/export_file_spec.rb4
-rw-r--r--spec/lib/gitlab/import_export/relation_factory_spec.rb11
2 files changed, 13 insertions, 2 deletions
diff --git a/spec/features/projects/import_export/export_file_spec.rb b/spec/features/projects/import_export/export_file_spec.rb
index 2fbfe045b7f..16dddb2a86b 100644
--- a/spec/features/projects/import_export/export_file_spec.rb
+++ b/spec/features/projects/import_export/export_file_spec.rb
@@ -74,8 +74,8 @@ feature 'Import/Export - project export integration test', feature: true, js: tr
Otherwise, please add the exception to +safe_list+ in CURRENT_SPEC using #{sensitive_word} as the key and the
correspondent hash or model as the value.
- Also, if the attribute is encrypted, please add it to either the list of excluded attributes in IMPORT_EXPORT_CONFIG
- or the model to RelationFactory::TOKEN_RESET_MODELS if it includes a token that can be reset.
+ Also, if the attribute is a generated unique token, please add it to RelationFactory::TOKEN_RESET_MODELS if it needs to be
+ reset (to prevent duplicate column problems while importing to the same instance).
IMPORT_EXPORT_CONFIG: #{Gitlab::ImportExport.config_file}
CURRENT_SPEC: #{__FILE__}
diff --git a/spec/lib/gitlab/import_export/relation_factory_spec.rb b/spec/lib/gitlab/import_export/relation_factory_spec.rb
index d381316c7fe..c6370f3c164 100644
--- a/spec/lib/gitlab/import_export/relation_factory_spec.rb
+++ b/spec/lib/gitlab/import_export/relation_factory_spec.rb
@@ -178,4 +178,15 @@ describe Gitlab::ImportExport::RelationFactory, lib: true do
expect(created_object.author).to eq(new_user)
end
end
+
+ context 'encrypted attributes' do
+ let(:relation_sym) { 'Ci::Variable' }
+ let(:relation_hash) do
+ create(:ci_variable).as_json
+ end
+
+ it 'maps the right author to the imported note' do
+ expect(created_object.value).to be_nil
+ end
+ end
end