1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/test/integration/baumspage_importer_test.rb

31 lines
950 B
Ruby

require 'test_helper'
class BaumspageImporterTest < ActionDispatch::IntegrationTest
def setup
@school = School.find(1)
@baums_text = "***** 2019-01-09 13:36:50 *****
Some School
Some Guy
106,,,,,,,,,
113,Guy,Another,9,,,,,5,7
120,Guy2,Another,9,,,,,0,0
126,Guy3,Another,10,,,,5@120,2,2
******* Extra Wrestlers *******
120,Guy4,Another,10,0,3
126,Guy5,Another,9,,"
end
test "5 wrestlers get created with Baumspage Importer" do
BaumspageRosterImport.new(@school,@baums_text).import_roster
assert @school.reload.wrestlers.size == 5
extras = @school.wrestlers.select{|w| w.extra == true}
assert extras.size == 2
guy = @school.wrestlers.select{|w| w.name == "Another Guy"}.first
assert guy.season_win == 5
assert guy.season_loss == 7
guy5 = @school.wrestlers.select{|w| w.name == "Another Guy5"}.first
assert guy5.season_win == 0
assert guy5.season_loss == 0
end
end