|
|
|
@ -218,47 +218,11 @@ RSpec.describe Cleaner do
|
|
|
|
data = [SurveyItemValues.new(row: { "Recorded Date" => recorded_date, "Dese ID" => "1_740_505" }, headers: early_education_survey_items, survey_items:,
|
|
|
|
data = [SurveyItemValues.new(row: { "Recorded Date" => recorded_date, "Dese ID" => "1_740_505" }, headers: early_education_survey_items, survey_items:,
|
|
|
|
schools: School.school_hash)]
|
|
|
|
schools: School.school_hash)]
|
|
|
|
filename = Cleaner.new(input_filepath:, output_filepath:, log_filepath:).filename(
|
|
|
|
filename = Cleaner.new(input_filepath:, output_filepath:, log_filepath:).filename(
|
|
|
|
headers: early_education_survey_items, data:, filepath: "/data/survey_responses/maynard early ed_ form a.2022-23.csv"
|
|
|
|
headers: early_education_survey_items, data:, filepath: "/data/survey_responses/maynard early ed_ part a.2022-23.csv"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
expect(filename).to eq "maynard.maynard-high-school.early_education.Part-A.2022-23.csv"
|
|
|
|
expect(filename).to eq "maynard.maynard-high-school.early_education.Part-A.2022-23.csv"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
context "when the file name includes the words 'form'" do
|
|
|
|
|
|
|
|
it "adds the part to the filename" do
|
|
|
|
|
|
|
|
survey_items = SurveyItem.where(survey_item_id: early_education_survey_items)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = [SurveyItemValues.new(row: { "Recorded Date" => recorded_date, "Dese ID" => "1_740_505" }, headers: early_education_survey_items, survey_items:,
|
|
|
|
|
|
|
|
schools: School.school_hash)]
|
|
|
|
|
|
|
|
filename = Cleaner.new(input_filepath:, output_filepath:, log_filepath:).filename(
|
|
|
|
|
|
|
|
headers: early_education_survey_items, data:, filepath: "/data/survey_responses/maynard early ed_ form f.2022-23.csv"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
expect(filename).to eq "maynard.maynard-high-school.early_education.Part-F.2022-23.csv"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when the file name includes the words 'form'" do
|
|
|
|
|
|
|
|
it "adds the part to the filename" do
|
|
|
|
|
|
|
|
survey_items = SurveyItem.where(survey_item_id: early_education_survey_items)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = [SurveyItemValues.new(row: { "Recorded Date" => recorded_date, "Dese ID" => "1_740_505" }, headers: early_education_survey_items, survey_items:,
|
|
|
|
|
|
|
|
schools: School.school_hash)]
|
|
|
|
|
|
|
|
filename = Cleaner.new(input_filepath:, output_filepath:, log_filepath:).filename(
|
|
|
|
|
|
|
|
headers: early_education_survey_items, data:, filepath: "/data/survey_responses/maynard early ed_ form_f.2022-23.csv"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
expect(filename).to eq "maynard.maynard-high-school.early_education.Part-F.2022-23.csv"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when the file name includes the words 'form'" do
|
|
|
|
|
|
|
|
it "adds the part to the filename" do
|
|
|
|
|
|
|
|
survey_items = SurveyItem.where(survey_item_id: early_education_survey_items)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = [SurveyItemValues.new(row: { "Recorded Date" => recorded_date, "Dese ID" => "1_740_505" }, headers: early_education_survey_items, survey_items:,
|
|
|
|
|
|
|
|
schools: School.school_hash)]
|
|
|
|
|
|
|
|
filename = Cleaner.new(input_filepath:, output_filepath:, log_filepath:).filename(
|
|
|
|
|
|
|
|
headers: early_education_survey_items, data:, filepath: "/data/survey_responses/maynard early ed_ form&f.2022-23.csv"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
expect(filename).to eq "maynard.maynard-high-school.early_education.Part-F.2022-23.csv"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|