Allinea stato e titolo replay del tabellone al risultato reale.
Una gara con punteggio non resta più «In programma» solo perché l'orario è futuro, e i replay usano le squadre del match invece della squadra di trasmissione. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -31,4 +31,45 @@ RSpec.describe Recording do
|
||||
rec = described_class.create!(stream_session: session, team: team, status: "processing")
|
||||
expect(rec.title_or_default).to eq("Team vs Rival")
|
||||
end
|
||||
|
||||
it "usa le squadre del tabellone al posto della squadra di trasmissione" do
|
||||
load Rails.root.join("db/seeds/plans.rb")
|
||||
Billing::AssignPlan.call(club: club, plan_slug: "premium_full")
|
||||
ClubMembership.create!(user: user, club: club, role: "owner")
|
||||
tournament = Tournaments::Create.call(
|
||||
club: club,
|
||||
attrs: {
|
||||
name: "Memorial",
|
||||
sport_key: "pallavolo",
|
||||
starts_on: Date.current,
|
||||
ends_on: Date.current,
|
||||
format_kind: "free"
|
||||
}
|
||||
)
|
||||
home = tournament.participants.create!(name: "Gamma")
|
||||
away = tournament.participants.create!(name: "Beta")
|
||||
tournament_match = Tournaments::ScheduleMatch.call(
|
||||
tournament: tournament,
|
||||
attrs: {
|
||||
home_participant_id: home.id,
|
||||
away_participant_id: away.id,
|
||||
scheduled_at: 1.hour.from_now
|
||||
}
|
||||
)
|
||||
tournament_session = StreamSession.create!(
|
||||
match: tournament_match,
|
||||
user: user,
|
||||
platform: "matchlivetv",
|
||||
status: "ended",
|
||||
privacy_status: "public"
|
||||
)
|
||||
rec = described_class.create!(
|
||||
stream_session: tournament_session,
|
||||
team: tournament.broadcast_team,
|
||||
status: "ready",
|
||||
title: "#{tournament.broadcast_team.name} vs Beta"
|
||||
)
|
||||
expect(rec.title_or_default).to eq("Gamma vs Beta")
|
||||
expect(rec.default_title).to eq("Gamma vs Beta")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user