diff --git a/app/services/dese/four_d_one.rb b/app/services/dese/four_d_one.rb index 5296f380..af07bbb4 100644 --- a/app/services/dese/four_d_one.rb +++ b/app/services/dese/four_d_one.rb @@ -3,7 +3,7 @@ require 'csv' module Dese class FourDOne - def initialize(filepath: Rails.root.join('data', 'admin_data', 'dese', 'four_d.csv')) + def initialize(filepath: Rails.root.join('data', 'admin_data', 'dese', '4D_1_plans_of_grads.csv')) url = 'https://profiles.doe.mass.edu/statereport/plansofhsgrads.aspx' browser = Watir::Browser.new write_headers(filepath:) diff --git a/app/services/dese/one_a_one.rb b/app/services/dese/one_a_one.rb index ffcb5dfa..847c866a 100644 --- a/app/services/dese/one_a_one.rb +++ b/app/services/dese/one_a_one.rb @@ -3,7 +3,7 @@ require 'csv' module Dese class OneAOne - def initialize(filepath: Rails.root.join('data', 'admin_data', 'dese', 'one_a_one_teacher_data.csv')) + def initialize(filepath: Rails.root.join('data', 'admin_data', 'dese', '1A_1_teacher_data.csv')) url = 'https://profiles.doe.mass.edu/statereport/teacherdata.aspx' browser = Watir::Browser.new write_headers(filepath:) diff --git a/app/services/dese/one_a_three.rb b/app/services/dese/one_a_three.rb index b2281361..ceb6db2b 100644 --- a/app/services/dese/one_a_three.rb +++ b/app/services/dese/one_a_three.rb @@ -6,8 +6,8 @@ module Dese include Dese::Scraper attr_reader :filepaths - def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', 'one_a_three_staffing_retention.csv'), - Rails.root.join('data', 'admin_data', 'dese', 'one_a_three_teachers_of_color.csv')]) + def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', '1A_3_staffing_retention.csv'), + Rails.root.join('data', 'admin_data', 'dese', '1A_3_teachers_of_color.csv')]) @filepaths = filepaths end diff --git a/app/services/dese/three_a_one.rb b/app/services/dese/three_a_one.rb index 9531147e..6039a7b0 100644 --- a/app/services/dese/three_a_one.rb +++ b/app/services/dese/three_a_one.rb @@ -6,7 +6,7 @@ module Dese include Dese::Scraper attr_reader :filepaths - def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', 'three_a_one_gender_population.csv')]) + def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', '3A_1_average_class_size.csv')]) @filepaths = filepaths end diff --git a/app/services/dese/three_a_two.rb b/app/services/dese/three_a_two.rb index aae07e0e..9445126b 100644 --- a/app/services/dese/three_a_two.rb +++ b/app/services/dese/three_a_two.rb @@ -6,9 +6,9 @@ module Dese include Dese::Scraper attr_reader :filepaths - def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', 'enrollment.csv'), - Rails.root.join('data', 'admin_data', 'dese', 'three_a_two_age_staffing.csv'), - Rails.root.join('data', 'admin_data', 'dese', 'three_a_two_grade_subject_staffing.csv')]) + def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', '3A_2_enrollment.csv'), + Rails.root.join('data', 'admin_data', 'dese', '3A_2_age_staffing.csv'), + Rails.root.join('data', 'admin_data', 'dese', '3A_2_grade_subject_staffing.csv')]) @filepaths = filepaths end diff --git a/app/services/dese/three_b_one.rb b/app/services/dese/three_b_one.rb index e15c8bdd..0bdfa78d 100644 --- a/app/services/dese/three_b_one.rb +++ b/app/services/dese/three_b_one.rb @@ -6,9 +6,9 @@ module Dese include Dese::Scraper attr_reader :filepaths - def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', 'three_b_one_masscore.csv'), - Rails.root.join('data', 'admin_data', 'dese', 'three_b_one_advcoursecomprate.csv'), - Rails.root.join('data', 'admin_data', 'dese', 'three_b_one_ap.csv')]) + def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', '3B_1_masscore.csv'), + Rails.root.join('data', 'admin_data', 'dese', '3B_1_advcoursecomprate.csv'), + Rails.root.join('data', 'admin_data', 'dese', '3B_1_ap.csv')]) @filepaths = filepaths end diff --git a/app/services/dese/two_a_one.rb b/app/services/dese/two_a_one.rb index d9ba9c49..f025eafe 100644 --- a/app/services/dese/two_a_one.rb +++ b/app/services/dese/two_a_one.rb @@ -6,8 +6,8 @@ module Dese include Dese::Scraper attr_reader :filepaths - def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', 'two_a_one_students_suspended.csv'), - Rails.root.join('data', 'admin_data', 'dese', 'two_a_one_students_disciplined.csv')]) + def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', '2A_1_students_suspended.csv'), + Rails.root.join('data', 'admin_data', 'dese', '2A_1_students_disciplined.csv')]) @filepaths = filepaths end diff --git a/app/services/dese/two_c_one.rb b/app/services/dese/two_c_one.rb index ec7e0057..95ad83eb 100644 --- a/app/services/dese/two_c_one.rb +++ b/app/services/dese/two_c_one.rb @@ -6,7 +6,7 @@ module Dese include Dese::Scraper attr_reader :filepaths - def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', 'two_c_one_attendance.csv')]) + def initialize(filepaths: [Rails.root.join('data', 'admin_data', 'dese', '2C_1_attendance.csv')]) @filepaths = filepaths end diff --git a/spec/services/dese/four_d_scraper_spec.rb b/spec/services/dese/four_d_one_spec.rb similarity index 61% rename from spec/services/dese/four_d_scraper_spec.rb rename to spec/services/dese/four_d_one_spec.rb index 451934cf..4660d66b 100644 --- a/spec/services/dese/four_d_scraper_spec.rb +++ b/spec/services/dese/four_d_one_spec.rb @@ -4,10 +4,10 @@ RSpec.describe Dese::FourDOne do let(:academic_years) do [ create(:academic_year, range: '2020-21'), - create(:academic_year, range: '2019-20'), - create(:academic_year, range: '2018-19'), - create(:academic_year, range: '2017-18'), - create(:academic_year, range: '2016-17') + create(:academic_year, range: '2019-20') + # create(:academic_year, range: '2018-19'), + # create(:academic_year, range: '2017-18'), + # create(:academic_year, range: '2016-17') ] end before :each do @@ -17,7 +17,7 @@ RSpec.describe Dese::FourDOne do xcontext 'Creating a new FourDOne' do it 'creates a csv file with the scraped data' do FileUtils.mkdir_p 'tmp/spec/dese' - file = Rails.root.join('tmp', 'spec', 'dese', 'four_d.csv') + file = Rails.root.join('tmp', 'spec', 'dese', '4D_1_plans_of_grads.csv') Dese::FourDOne.new(filepath: file) expect(file).to exist end diff --git a/spec/services/dese/one_a_scraper_spec.rb b/spec/services/dese/one_a_one_spec.rb similarity index 96% rename from spec/services/dese/one_a_scraper_spec.rb rename to spec/services/dese/one_a_one_spec.rb index ee67578b..5d684eb0 100644 --- a/spec/services/dese/one_a_scraper_spec.rb +++ b/spec/services/dese/one_a_one_spec.rb @@ -13,7 +13,7 @@ RSpec.describe Dese::OneAOne do # create(:academic_year, range: '2016-17') ] end - let(:filepath) { Rails.root.join('tmp', 'spec', 'dese', 'one_a_one_teacher_data.csv') } + let(:filepath) { Rails.root.join('tmp', 'spec', 'dese', '1A_1_teacher_data.csv') } before do FileUtils.mkdir_p 'tmp/spec/dese' end @@ -47,6 +47,7 @@ RSpec.describe Dese::OneAOne do 4.5, 4.21, 4.1, 5, 4.2, 4.51, 3.97, 4.35, 4.38, 4.08, 4, 4.12, 5] end + it 'has the right likert score results for a-exp-i3' do results = CSV.parse(File.read(filepath), headers: true).map do |row| next unless row['Admin Data Item'] == 'a-exp-i3' && row['Academic Year'] == '2020-21' diff --git a/spec/services/dese/one_a_three_spec.rb b/spec/services/dese/one_a_three_spec.rb index f05cf7e6..8088ed60 100644 --- a/spec/services/dese/one_a_three_spec.rb +++ b/spec/services/dese/one_a_three_spec.rb @@ -13,8 +13,8 @@ RSpec.describe Dese::OneAThree do # create(:academic_year, range: '2016-17') ] end - let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'one_a_three_staffing_retention.csv') } - let(:i3_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'one_a_three_teachers_of_color.csv') } + let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', '1A_3_staffing_retention.csv') } + let(:i3_filepath) { Rails.root.join('tmp', 'spec', 'dese', '1A_3_teachers_of_color.csv') } let(:filepaths) do [i1_filepath, i3_filepath] @@ -27,7 +27,7 @@ RSpec.describe Dese::OneAThree do academic_years end - context 'Creating a new Scraper' do + xcontext 'Creating a new Scraper' do it 'creates a csv file with the scraped data' do Dese::OneAThree.new(filepaths:).run_all expect(i1_filepath).to exist diff --git a/spec/services/dese/three_a_one_spec.rb b/spec/services/dese/three_a_one_spec.rb index 7e446c9d..3fe78779 100644 --- a/spec/services/dese/three_a_one_spec.rb +++ b/spec/services/dese/three_a_one_spec.rb @@ -14,7 +14,7 @@ RSpec.describe Dese::ThreeAOne do ] end - let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'three_a_one_average_class_size.csv') } + let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', '3A_1_average_class_size.csv') } let(:filepaths) do [i1_filepath] @@ -27,7 +27,7 @@ RSpec.describe Dese::ThreeAOne do academic_years end - context 'Creating a new Scraper' do + xcontext 'Creating a new Scraper' do it 'creates a csv file with the scraped data' do Dese::ThreeAOne.new(filepaths:).run_all expect(i1_filepath).to exist diff --git a/spec/services/dese/three_a_two_spec.rb b/spec/services/dese/three_a_two_spec.rb index 2587f0dc..718ec0e5 100644 --- a/spec/services/dese/three_a_two_spec.rb +++ b/spec/services/dese/three_a_two_spec.rb @@ -14,9 +14,9 @@ RSpec.describe Dese::ThreeATwo do ] end - let(:enrollment_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'enrollment.csv') } - let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'three_a_two_age_staffing.csv') } - let(:i4_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'three_a_two_grade_subject_staffing.csv') } + let(:enrollment_filepath) { Rails.root.join('tmp', 'spec', 'dese', '3A_2_enrollment.csv') } + let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', '3A_2_age_staffing.csv') } + let(:i4_filepath) { Rails.root.join('tmp', 'spec', 'dese', '3A_2_grade_subject_staffing.csv') } let(:filepaths) do [enrollment_filepath, i1_filepath, i4_filepath] diff --git a/spec/services/dese/three_b_one_spec.rb b/spec/services/dese/three_b_one_spec.rb index 70f5b21c..dc98b0f6 100644 --- a/spec/services/dese/three_b_one_spec.rb +++ b/spec/services/dese/three_b_one_spec.rb @@ -14,9 +14,9 @@ RSpec.describe Dese::ThreeBOne do ] end - let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'three_b_one_masscore.csv') } - let(:i2_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'three_b_one_advcoursecomprate.csv') } - let(:i3_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'three_b_one_ap.csv') } + let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', '3B_1_masscore.csv') } + let(:i2_filepath) { Rails.root.join('tmp', 'spec', 'dese', '3B_1_advcoursecomprate.csv') } + let(:i3_filepath) { Rails.root.join('tmp', 'spec', 'dese', '3B_1_ap.csv') } let(:filepaths) do [i1_filepath, i2_filepath, i3_filepath] diff --git a/spec/services/dese/two_a_one_spec.rb b/spec/services/dese/two_a_one_spec.rb index 081251ff..96b7cf73 100644 --- a/spec/services/dese/two_a_one_spec.rb +++ b/spec/services/dese/two_a_one_spec.rb @@ -14,8 +14,8 @@ RSpec.describe Dese::TwoAOne do ] end - let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'two_a_one_students_suspended.csv') } - let(:i3_filepath) { Rails.root.join('tmp', 'spec', 'dese', 'two_a_one_students_disciplined.csv') } + let(:i1_filepath) { Rails.root.join('tmp', 'spec', 'dese', '2A_1_students_suspended.csv') } + let(:i3_filepath) { Rails.root.join('tmp', 'spec', 'dese', '2A_1_students_disciplined.csv') } let(:filepaths) do [i1_filepath, i3_filepath]