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

Added a turbo stream for the current and next match on mat stats page.

This commit is contained in:
2026-01-09 18:37:01 -05:00
parent 8c2ddf55ed
commit 3576445a1c
6 changed files with 175 additions and 7 deletions

View File

@@ -0,0 +1,29 @@
require "test_helper"
class MatsCurrentMatchPartialTest < ActionView::TestCase
include ActionView::RecordIdentifier
test "renders current match contents when assigned" do
create_double_elim_tournament_single_weight_1_6(4)
mat = @tournament.mats.create!(name: "Mat 1")
match = @tournament.matches.first
match.update!(mat: mat)
render partial: "mats/current_match", locals: { mat: mat }
assert_includes rendered, "Bout"
assert_includes rendered, match.bout_number.to_s
assert_includes rendered, mat.name
end
test "renders friendly message when no matches assigned" do
create_double_elim_tournament_single_weight_1_6(4)
mat = @tournament.mats.create!(name: "Mat 1")
@tournament.matches.update_all(mat_id: nil)
render partial: "mats/current_match", locals: { mat: mat }
assert_includes rendered, "No matches assigned to this mat."
end
end