Commit e461650f authored by Jacob Schatz's avatar Jacob Schatz Committed by Micaël Bergeron

Fix failing tests.

parent 1481e45b
...@@ -44,12 +44,13 @@ module Pseudonymity ...@@ -44,12 +44,13 @@ module Pseudonymity
raise "No such directory #{@csv_output}" raise "No such directory #{@csv_output}"
end end
tables.each do |k, v| new_tables = tables.map do |k, v|
@schema[k] = {} @schema[k] = {}
table_to_csv(k, v["whitelist"], v["pseudo"]) table_to_csv(k, v["whitelist"], v["pseudo"])
end end
schema_to_yml schema_to_yml
file_list_to_json file_list_to_json
new_tables
end end
def get_and_log_file_name(ext, prefix = nil, filename = nil) def get_and_log_file_name(ext, prefix = nil, filename = nil)
...@@ -102,7 +103,7 @@ module Pseudonymity ...@@ -102,7 +103,7 @@ module Pseudonymity
end end
def parse_config def parse_config
@config = YAML.load_file(Rails.root.join('lib/assets/pseudonymity_dump.yml')) @config = YAML.load_file(Rails.root.join('./ee/lib/assets/pseudonymity_dump.yml'))
end end
def write_to_csv_file(title, contents) def write_to_csv_file(title, contents)
......
...@@ -24,12 +24,12 @@ describe Gitlab::Pseudonymity do ...@@ -24,12 +24,12 @@ describe Gitlab::Pseudonymity do
# grab the first table it outputs. There would only be 1. # grab the first table it outputs. There would only be 1.
project_table_file = pseudo.tables_to_csv[0] project_table_file = pseudo.tables_to_csv[0]
# Ignore the `.` and `..` in the directory. # Ignore the `.` and `..` in the directory.
entry = Dir.entries(base_dir)[2] entry = Dir.entries(base_dir)[2]
expect(project_table_file.include? "projects_").to be true expect(project_table_file.include? "projects_").to be true
expect(project_table_file.include? ".csv").to be true expect(project_table_file.include? ".csv").to be true
expect(project_table_file.include? entry).to be true
columns = [] columns = []
project_data = [] project_data = []
File.foreach(project_table_file).with_index do |line, line_num| File.foreach(project_table_file).with_index do |line, line_num|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment