excel_loader_test.rb 470 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
require 'test_helper'
load 'db/excel_loader.rb'

class ExcelLoaderTest < ActiveSupport::TestCase
  NUMBER_ADDED_BY_FIXTURES = 2
  test 'loads data correctly' do
    loader = ExcelLoader.new 'db/data/testdata.xlsx'
    loader.load_data

    assert(Semester.count > NUMBER_ADDED_BY_FIXTURES, 'No semester loaded')
    assert(Course.count > NUMBER_ADDED_BY_FIXTURES, 'No courses loaded')
    assert(Section.count > NUMBER_ADDED_BY_FIXTURES, 'No sections loaded')
  end
end