1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added integration tests for import and backup

This commit is contained in:
2025-01-04 18:14:33 -05:00
parent 50055fc278
commit f3e0f5d4c5
3 changed files with 415 additions and 2 deletions

View File

@@ -28,7 +28,14 @@ class TournamentBackupService
private
def generate_json
{
@tournament.reload
@tournament.schools.reload
@tournament.weights.reload
@tournament.mats.reload
@tournament.mat_assignment_rules.reload
@tournament.wrestlers.reload
@tournament.matches.reload
data = {
tournament: {
attributes: @tournament.attributes,
schools: @tournament.schools.map(&:attributes),
@@ -59,5 +66,7 @@ class TournamentBackupService
end
}
}
# puts "Generated JSON for backup: #{data[:tournament][:mats]}"
data
end
end

View File

@@ -43,7 +43,6 @@ class WrestlingdevImporter
parse_mats(@import_data["tournament"]["mats"])
parse_wrestlers(@import_data["tournament"]["wrestlers"])
parse_matches(@import_data["tournament"]["matches"])
puts "Parsing mat assignment rules"
parse_mat_assignment_rules(@import_data["tournament"]["mat_assignment_rules"])
end