mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-02 21:24:25 +00:00
Added baumspage roster importer
This commit is contained in:
28
test/integration/baumspage_importer_test.rb
Normal file
28
test/integration/baumspage_importer_test.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user