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:
@@ -767,7 +767,7 @@ RSpec.describe "Tournaments", type: :request do
|
||||
session.update_columns(status: "ended", ended_at: Time.current)
|
||||
Recording.create!(
|
||||
stream_session: session, team: tournament.broadcast_team, status: "ready", privacy_status: "public",
|
||||
title: "Replay Alfa-Beta",
|
||||
title: "#{tournament.broadcast_team.name} vs #{away.name}",
|
||||
storage_key: "teams/#{tournament.broadcast_team_id}/sessions/#{session.id}/replay.mp4"
|
||||
)
|
||||
|
||||
@@ -775,9 +775,45 @@ RSpec.describe "Tournaments", type: :request do
|
||||
expect(response.body).to include("Guarda replay")
|
||||
expect(response.body).to include(public_replay_path(session.id))
|
||||
expect(response.body).to include("tournament-live-status--replay")
|
||||
expect(response.body).to include("Replay Alfa-Beta")
|
||||
expect(response.body).to include("#{home.name} vs #{away.name}")
|
||||
expect(response.body).not_to include("#{tournament.broadcast_team.name} vs #{away.name}")
|
||||
|
||||
get public_club_tournaments_path(club)
|
||||
expect(response.body).to include(public_tournament_page_path(tournament.slug))
|
||||
end
|
||||
|
||||
it "marca Terminata una gara con risultato anche se l'orario è ancora futuro" do
|
||||
assign_plan!("premium_full")
|
||||
login!
|
||||
tournament = Tournaments::Create.call(
|
||||
club: club,
|
||||
attrs: {
|
||||
name: "Open Risultato Anticipato",
|
||||
sport_key: "pallavolo",
|
||||
starts_on: Date.current,
|
||||
ends_on: Date.current + 1,
|
||||
format_kind: "free",
|
||||
courts: "Campo 1"
|
||||
}
|
||||
)
|
||||
home = tournament.participants.create!(name: "Alfa")
|
||||
away = tournament.participants.create!(name: "Delta")
|
||||
match = Tournaments::ScheduleMatch.call(
|
||||
tournament: tournament,
|
||||
attrs: {
|
||||
home_participant_id: home.id,
|
||||
away_participant_id: away.id,
|
||||
court: "Campo 1",
|
||||
scheduled_at: 6.hours.from_now
|
||||
}
|
||||
)
|
||||
Tournaments::RecordResult.call(match: match, home_score: 2, away_score: 0, source: "manual")
|
||||
post public_publish_tournament_path(tournament)
|
||||
|
||||
get public_tournament_page_path(tournament.slug, tab: "risultati")
|
||||
expect(response.body).to include("2–0")
|
||||
expect(response.body).to include("tournament-live-status--ended")
|
||||
expect(response.body).to include("Terminata")
|
||||
expect(response.body).not_to include("tournament-live-status--scheduled")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user