Create ui for data filters. Add listeners to direct to the correct url. Update ui based on the list of selected params
parent
4f0b92fa79
commit
765ad6a624
@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parserOptions": {
|
||||||
|
"sourceType": "module",
|
||||||
|
"ecmaVersion": 2020
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parserOptions": {
|
||||||
|
"sourceType": "module",
|
||||||
|
"ecmaVersion": 2020
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
module AnalysisGraph
|
||||||
|
class StudentsAndTeachers
|
||||||
|
def to_s
|
||||||
|
'Students & Teachers'
|
||||||
|
end
|
||||||
|
|
||||||
|
def value
|
||||||
|
'students-and-teachers'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
module AnalysisGraph
|
||||||
|
class StudentsByGroup
|
||||||
|
def to_s
|
||||||
|
'Students by Group'
|
||||||
|
end
|
||||||
|
|
||||||
|
def value
|
||||||
|
'students-by-group'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
class Race < ApplicationRecord
|
||||||
|
include FriendlyId
|
||||||
|
friendly_id :designation, use: [:slugged]
|
||||||
|
end
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'csv'
|
||||||
|
|
||||||
|
class DemographicLoader
|
||||||
|
def self.load_data(filepath:)
|
||||||
|
CSV.parse(File.read(filepath), headers: true) do |row|
|
||||||
|
qualtrics_code = row['Race Qualtrics Code'].to_i
|
||||||
|
designation = row['Race/Ethnicity']
|
||||||
|
next unless qualtrics_code && designation
|
||||||
|
|
||||||
|
if qualtrics_code.between?(6, 7)
|
||||||
|
UnknownRace.new(qualtrics_code:, designation:)
|
||||||
|
else
|
||||||
|
KnownRace.new(qualtrics_code:, designation:)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class KnownRace
|
||||||
|
def initialize(qualtrics_code:, designation:)
|
||||||
|
Race.find_or_create_by!(qualtrics_code:, designation:)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class UnknownRace
|
||||||
|
def initialize(qualtrics_code:, designation:)
|
||||||
|
Race.find_or_create_by!(qualtrics_code: 99, designation: 'Unknown')
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
<h3 class="sub-header-4 mt-5">Data Filters</h3>
|
||||||
|
<div class="bg-gray p-3" data-controller="analyze">
|
||||||
|
<% @graphs.each do |graph| %>
|
||||||
|
<div>
|
||||||
|
<input type="radio" id="<%= graph.value %>" name="graph"
|
||||||
|
value="<%= base_url %>"
|
||||||
|
data-action="click->analyze#refresh"
|
||||||
|
<%= graph.value == @graph ? "checked" : "" %>>
|
||||||
|
<label for="<%= graph.value %>"><%= graph.to_s %></label>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<p class="sub-header-5 mt-3 font-size-14"> Select a group </p>
|
||||||
|
|
||||||
|
<% @races.each do |race | %>
|
||||||
|
<div class="d-flex <%= race.slug %>">
|
||||||
|
<input
|
||||||
|
id="<%= race.slug %>"
|
||||||
|
class="m-3 race-checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
name="race-checkbox"
|
||||||
|
value="<%= base_url %>"
|
||||||
|
data-action="click->analyze#refresh"
|
||||||
|
<%= @selected_races.map(&:slug).include?(race.slug) ? "checked" : "" %>>
|
||||||
|
<label for="<%= race.qualtrics_code %>"><%= race.designation %></label>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
<h3 class="sub-header-4">Focus Area</h3>
|
||||||
|
<p>Select a category & subcategory to analyze measure-level results</p>
|
||||||
|
<select id="select-category" class="mx-3 form-select" data-id="category-dropdown" data-action="analyze#refresh">
|
||||||
|
<% categories.each do |category| %>
|
||||||
|
<option value="<%= analyze_category_link(district: district, school: school, academic_year: academic_year, category: category) %>" <%= category.id == category.id ? "selected": "" %>><%= "#{category.category_id}: #{category.name}" %></option>
|
||||||
|
<% end %>
|
||||||
|
</select>
|
||||||
|
<select id="select-subcategory" class="mx-3 form-select mt-3" data-id="subcategory-dropdown" data-action="analyze#refresh">
|
||||||
|
<% subcategories.each do |subcategory| %>
|
||||||
|
<option value="<%= analyze_subcategory_link(district: district, school: school, academic_year: academic_year, category: category, subcategory: subcategory) %>" <%= subcategory.subcategory_id == subcategory.subcategory_id ? "selected": "" %>>
|
||||||
|
<%= "#{subcategory.subcategory_id}: #{subcategory.name}" %>
|
||||||
|
</option>
|
||||||
|
<% end %>
|
||||||
|
</select>
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
<g id="graph-background">
|
||||||
|
<rect x="0" y="0" width="100%" height="<%= analyze_zone_height * 2 %>%" fill="#edecf0" />
|
||||||
|
<rect x="0" y="<%= analyze_zone_height * 2 %>%" width="100%" height="<%= analyze_zone_height * 3 %>%" fill="#fffaee" />
|
||||||
|
<rect x="0" y="0" width="100%" height="<%= analyze_graph_height %>%" fill="none" stroke="grey" />
|
||||||
|
<line x1="<%= column_end_x(1) %>%" y1="0" x2="<%= column_end_x(1) %>%" y2="85%" stroke="grey" stroke-width="1" stroke-dasharray="5,2" />
|
||||||
|
<line x1="<%= column_end_x(2) %>%" y1="0" x2="<%= column_end_x(2) %>%" y2="85%" stroke="grey" stroke-width="1" stroke-dasharray="5,2" />
|
||||||
|
<rect x="0" y="<%= benchmark_y %>%" width="100%" height="<%= benchmark_height %>%" fill="black" />
|
||||||
|
|
||||||
|
<g id="zone-dividers" stroke-width="1">
|
||||||
|
<line x1="0" y1="17%" x2="100%" y2="17%" stroke="white" />
|
||||||
|
<line x1="0" y1="51%" x2="100%" y2="51%" stroke="#edecf0" />
|
||||||
|
<line x1="0" y1="68%" x2="100%" y2="68%" stroke="#edecf0" />
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g id="zone-labels">
|
||||||
|
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(1) %>%" text-anchor="start" dominant-baseline="middle">
|
||||||
|
Ideal
|
||||||
|
</text>
|
||||||
|
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(2) %>%" text-anchor="start" dominant-baseline="middle">
|
||||||
|
Approval
|
||||||
|
</text>
|
||||||
|
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(3) %>%" text-anchor="start" dominant-baseline="middle">
|
||||||
|
Growth
|
||||||
|
</text>
|
||||||
|
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(4) %>%" text-anchor="start" dominant-baseline="middle">
|
||||||
|
Watch
|
||||||
|
</text>
|
||||||
|
<text class="zone-header" x="<%= zone_label_x %>%" y="<%= zone_label_y(5) %>%" text-anchor="start" dominant-baseline="middle">
|
||||||
|
Warning
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 472 B |
@ -1,34 +1,33 @@
|
|||||||
<g class="grouped-bar-column" data-for-measure-id="<%= presenter.measure.measure_id %>">
|
<g class="grouped-bar-column" data-for-measure-id="<%= presenter.measure.measure_id %>">
|
||||||
<% score_label_y = [5, 10, 15, 5, 10, 15 ] %>
|
<% score_label_y = [5, 10, 15, 5, 10, 15 ] %>
|
||||||
<% presenter.bars.each_with_index do |bar, index| %>
|
<% presenter.bars.each_with_index do |bar, index| %>
|
||||||
<rect data-for-academic-year="<%= bar.academic_year.range %>" x="<%= bar.x_position %>%" y="<%= bar.y_offset %>%" width="<%= presenter.bar_width %>%" height="<%= bar.bar_height_percentage %>%" fill="<%= bar.color %>" />
|
<rect data-for-academic-year="<%= bar.academic_year.range %>" x="<%= bar.x_position %>%" y="<%= bar.y_offset %>%" width="<%= presenter.bar_width %>%" height="<%= bar.bar_height_percentage %>%" fill="<%= bar.color %>" />
|
||||||
|
|
||||||
<% if ENV["SCORES"].present? && ENV["SCORES"].upcase == "SHOW" %>
|
<% if ENV["SCORES"].present? && ENV["SCORES"].upcase == "SHOW" %>
|
||||||
<text x="<%= bar.x_position + 3 %>%" y="<%= score_label_y[index] %>%" text-anchor="middle" dominant-baseline="middle" >
|
<text x="<%= bar.x_position + 3 %>%" y="<%= score_label_y[index] %>%" text-anchor="middle" dominant-baseline="middle">
|
||||||
<%= bar.average %>
|
<%= bar.average %>
|
||||||
</text>
|
</text>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<text class="graph-footer" x="<%= presenter.column_midpoint %>%" y="<%= bar_label_height %>%" text-anchor="middle" dominant-baseline="middle" data-grouped-bar-label="<%= presenter.label %>">
|
<text class="graph-footer" x="<%= presenter.column_midpoint %>%" y="<%= bar_label_height %>%" text-anchor="middle" dominant-baseline="middle" data-grouped-bar-label="<%= presenter.label %>">
|
||||||
<%= presenter.label %>
|
<%= presenter.label %>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<% if presenter.show_irrelevancy_message? %>
|
<% if presenter.show_irrelevancy_message? %>
|
||||||
<rect x="<%= presenter.message_x %>%" y="<%= presenter.message_y %>%" rx="15" ry="15" width="<%= presenter.message_width %>%" height="<%= presenter.message_height %>%" fill="white" stroke="gray"/>
|
<rect x="<%= presenter.message_x %>%" y="<%= presenter.message_y %>%" rx="15" ry="15" width="<%= presenter.message_width %>%" height="<%= presenter.message_height %>%" fill="white" stroke="gray" />
|
||||||
|
|
||||||
<text x="<%= presenter.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
|
<text x="<%= presenter.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
|
||||||
<tspan x="<%= presenter.column_midpoint %>%" y="29%">measure not</tspan>
|
<tspan x="<%= presenter.column_midpoint %>%" y="29%">measure not</tspan>
|
||||||
<tspan x="<%= presenter.column_midpoint %>%" y="34%">based on</tspan>
|
<tspan x="<%= presenter.column_midpoint %>%" y="34%">based on</tspan>
|
||||||
<tspan x="<%= presenter.column_midpoint %>%" y="39%"><%= presenter.basis %> surveys </tspan>
|
<tspan x="<%= presenter.column_midpoint %>%" y="39%"><%= presenter.basis %> surveys </tspan>
|
||||||
</text>
|
</text>
|
||||||
<% elsif presenter.show_insufficient_data_message? %>
|
<% elsif presenter.show_insufficient_data_message? %>
|
||||||
<rect x="<%= presenter.message_x %>%" y="<%= presenter.message_y %>%" rx="15" ry="15" width="<%= presenter.message_width %>%" height="<%= presenter.message_height %>%" fill="white" stroke="gray" />
|
<rect x="<%= presenter.message_x %>%" y="<%= presenter.message_y %>%" rx="15" ry="15" width="<%= presenter.message_width %>%" height="<%= presenter.message_height %>%" fill="white" stroke="gray" />
|
||||||
|
|
||||||
<text x="<%= presenter.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle" >
|
<text x="<%= presenter.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
|
||||||
<tspan x="<%= presenter.column_midpoint %>%" y="29%">survey response</tspan>
|
<tspan x="<%= presenter.column_midpoint %>%" y="29%">survey response</tspan>
|
||||||
<tspan x="<%= presenter.column_midpoint %>%" y="34%">rate below 25%</tspan>
|
<tspan x="<%= presenter.column_midpoint %>%" y="34%">rate below 25%</tspan>
|
||||||
</text>
|
</text>
|
||||||
<% end %>
|
<% end %>
|
||||||
</g>
|
</g>
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
<h3 class="sub-header-4 mt-5">School Years</h3>
|
||||||
|
<% available_academic_years.each_with_index do | year, index | %>
|
||||||
|
<div class="d-flex justify-content-start align-items-center mt-1" data-controller="analyze">
|
||||||
|
<input type="checkbox"
|
||||||
|
id="<%= year.range %>"
|
||||||
|
name="year-checkbox"
|
||||||
|
value="<%= analyze_subcategory_link(district: district, school: school, academic_year: academic_year, category: category, subcategory: subcategory) %>"
|
||||||
|
<%= selected_academic_years.include?(year) ? "checked" : "" %>
|
||||||
|
data-action="click->analyze#refresh"
|
||||||
|
<%= empty_dataset?(measures: measures, school: school, academic_year: year) ? "disabled" : "" %>>
|
||||||
|
|
||||||
|
<label class="px-3" for="<%= year.range %>"><%= year.range %></label><br>
|
||||||
|
<div class="bg-color-blue px-3" style="width:20px;height:20px;background-color:<%= colors[index] %>;"></div>
|
||||||
|
<% if empty_dataset?(measures: measures, school: school, academic_year: year) %>
|
||||||
|
<i class="fa-solid fa-circle-exclamation px-3"
|
||||||
|
data-bs-toggle="popover" data-bs-placement="right"
|
||||||
|
data-bs-content="Teacher and student survey response rates below <%= ResponseRateCalculator::TEACHER_RATE_THRESHOLD %>%">
|
||||||
|
</i>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
@ -1,66 +1,33 @@
|
|||||||
<% content_for :title do %>
|
<% content_for :title do %>
|
||||||
<h1 class="sub-header-2 color-white m-0"> Analysis of <%= @school.name %> </h1>
|
<h1 class="sub-header-2 color-white m-0"> Analysis of <%= @school.name %> </h1>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="graph-content">
|
<div class="graph-content">
|
||||||
<div class="breadcrumbs sub-header-4">
|
<div class="breadcrumbs sub-header-4">
|
||||||
<%= @category.category_id %>:<%= @category.name %> > <%= @subcategory.subcategory_id %>:<%= @subcategory.name %>
|
<%= @category.category_id %>:<%= @category.name %> > <%= @subcategory.subcategory_id %>:<%= @subcategory.name %>
|
||||||
</div>
|
</div>
|
||||||
<hr/>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex flex-row pt-5 row">
|
<div class="d-flex flex-row pt-5 row">
|
||||||
<div class="d-flex flex-column flex-grow-6 bg-color-white col-3 px-5" data-controller="analyze">
|
<div class="d-flex flex-column flex-grow-6 bg-color-white col-3 px-5" data-controller="analyze">
|
||||||
<h3 class="sub-header-4">Focus Area</h3>
|
<%= render partial: "focus_area", locals: {categories: @categories, district: @district, school: @school, academic_year: @academic_year, category: @category, subcategories: @subcategories} %>
|
||||||
<p>Select a category & subcategory to analyze measure-level results</p>
|
|
||||||
<select id="select-category" class="mx-3 form-select" data-id="category-dropdown" data-action="analyze#refresh">
|
|
||||||
<% @categories.each do |category| %>
|
|
||||||
<option value="<%= analyze_category_link(district: @district, school: @school, academic_year: @academic_year, category: category) %>" <%= @category.id == category.id ? "selected": "" %> ><%= "#{category.category_id}: #{category.name}" %></option>
|
|
||||||
<% end %>
|
|
||||||
</select>
|
|
||||||
<select id="select-subcategory" class="mx-3 form-select mt-3" data-id="subcategory-dropdown" data-action="analyze#refresh">
|
|
||||||
<% @subcategories.each do |subcategory| %>
|
|
||||||
<option value="<%= analyze_subcategory_link(district: @district, school: @school, academic_year: @academic_year, category: @category, subcategory: subcategory) %>" <%= @subcategory.subcategory_id == subcategory.subcategory_id ? "selected": "" %>>
|
|
||||||
<%= "#{subcategory.subcategory_id}: #{subcategory.name}" %>
|
|
||||||
</option>
|
|
||||||
<% end %>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<h3 class="sub-header-4 mt-5">School Years</h3>
|
<%= render partial: "school_years", locals: {available_academic_years: @available_academic_years, selected_academic_years: @selected_academic_years, district: @district, school: @school, academic_year: @academic_year, category: @category, subcategory: @subcategory, measures: @measures} %>
|
||||||
<% @available_academic_years.each_with_index do | year, index | %>
|
|
||||||
<div class="d-flex justify-content-start align-items-center mt-1" data-controller="analyze">
|
|
||||||
<input type="checkbox"
|
|
||||||
id="<%= year.range %>"
|
|
||||||
name="year-checkbox"
|
|
||||||
value="<%= analyze_subcategory_link(district: @district, school: @school, academic_year: @academic_year, category: @category, subcategory: @subcategory) %>"
|
|
||||||
<%= @selected_academic_years.include?(year) ? "checked" : "" %>
|
|
||||||
data-action="click->analyze#refresh"
|
|
||||||
<%= empty_dataset?(measures: @measures, school: @school, academic_year: year) ? "disabled" : "" %>
|
|
||||||
>
|
|
||||||
<label class="px-3" for="<%= year.range %>" ><%= year.range %></label><br>
|
|
||||||
<div class="bg-color-blue px-3" style="width:20px;height:20px;background-color:<%= colors[index] %>;"></div>
|
|
||||||
<% if empty_dataset?(measures: @measures, school: @school, academic_year: year) %>
|
|
||||||
<i class="fa-solid fa-circle-exclamation px-3"
|
|
||||||
data-bs-toggle="popover" data-bs-placement="right"
|
|
||||||
data-bs-content="Teacher and student survey response rates below <%= ResponseRateCalculator::TEACHER_RATE_THRESHOLD %>%" >
|
|
||||||
</i>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% cache [@subcategory, @school, @selected_academic_years, @response_rate_timestamp] do %>
|
<%= render partial: "data_filters", locals: {district: @district, school: @school, academic_year: @academic_year, category: @category, subcategory: @subcategory} %>
|
||||||
<div class="bg-color-white flex-grow-1 col-9">
|
</div>
|
||||||
<% @measures.each do |measure|%>
|
|
||||||
<section class="mb-6" >
|
|
||||||
<p class="construct-id">Measure <%= measure.measure_id %></p>
|
|
||||||
<h2> <%= measure.name %> </h2>
|
|
||||||
|
|
||||||
<%= render partial: "grouped_bar_chart" , locals: { measure: measure} %>
|
<% cache [@subcategory, @school, @selected_academic_years, @response_rate_timestamp] do %>
|
||||||
|
<div class="bg-color-white flex-grow-1 col-9">
|
||||||
|
<% @measures.each do |measure| %>
|
||||||
|
<section class="mb-6">
|
||||||
|
<p class="construct-id">Measure <%= measure.measure_id %></p>
|
||||||
|
<h2> <%= measure.name %> </h2>
|
||||||
|
|
||||||
</section>
|
<%= render partial: "grouped_bar_chart" , locals: { measure: measure} %>
|
||||||
<% end %>
|
</section>
|
||||||
</div>
|
<% end %>
|
||||||
<% end %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
class CreateRaces < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
create_table :races do |t|
|
||||||
|
t.string :designation
|
||||||
|
t.integer :qualtrics_code
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
add_index :races, :designation, unique: true
|
||||||
|
add_index :races, :qualtrics_code, unique: true
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
class AddSlugToRace < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_column :races, :slug, :string
|
||||||
|
add_index :races, :slug, unique: true
|
||||||
|
end
|
||||||
|
end
|
||||||
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,34 @@
|
|||||||
require 'rails_helper'
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'rails_helper'
|
||||||
RSpec.describe AdminDataValue, type: :model do
|
RSpec.describe AdminDataValue, type: :model do
|
||||||
pending "add some examples to (or delete) #{__FILE__}"
|
let(:school) { create(:school) }
|
||||||
|
let(:admin_data_item) { create(:admin_data_item) }
|
||||||
|
let(:academic_year) { create(:academic_year) }
|
||||||
|
context '#value' do
|
||||||
|
context 'when the value is in the valid range of greater than zero to five' do
|
||||||
|
it 'should return valid values' do
|
||||||
|
value = AdminDataValue.create!(likert_score: 1, school:, admin_data_item:, academic_year:)
|
||||||
|
expect(value.likert_score).to eq(1)
|
||||||
|
value = AdminDataValue.create!(likert_score: 2, school:, admin_data_item:, academic_year:)
|
||||||
|
expect(value.likert_score).to eq(2)
|
||||||
|
value = AdminDataValue.create!(likert_score: 5, school:, admin_data_item:, academic_year:)
|
||||||
|
expect(value.likert_score).to eq(5)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when the value is zero or below or greater than 5' do
|
||||||
|
it 'should not create the value' do
|
||||||
|
expect do
|
||||||
|
AdminDataValue.create!(likert_score: 0, school:, admin_data_item:,
|
||||||
|
academic_year:)
|
||||||
|
end.to raise_error
|
||||||
|
expect do
|
||||||
|
AdminDataValue.create!(likert_score: 5.00001, school:, admin_data_item:,
|
||||||
|
academic_year:)
|
||||||
|
end.to raise_error
|
||||||
|
expect(AdminDataValue.count).to eq(0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe Race, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
describe DemographicLoader do
|
||||||
|
let(:filepath) { 'spec/fixtures/sample_demographics.csv' }
|
||||||
|
|
||||||
|
before :each do
|
||||||
|
DemographicLoader.load_data(filepath:)
|
||||||
|
end
|
||||||
|
|
||||||
|
after :each do
|
||||||
|
DatabaseCleaner.clean
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'self.load_data' do
|
||||||
|
it 'does not load qualtrics categories for `prefer not to disclose` or `prefer to self-describe`' do
|
||||||
|
expect(Race.find_by_qualtrics_code(6)).to be nil
|
||||||
|
end
|
||||||
|
it 'loads all racial designations' do
|
||||||
|
expect(Race.all.count).to eq 8
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in new issue