Nasconde dall'hub le partite con risultato già inserito.
Restano avviabili solo le gare in ritardo senza punteggio, non quelle già terminate dal portale. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -83,6 +83,48 @@ RSpec.describe Match, "scheduling scopes" do
|
||||
expect(match.coach_hub_visible?).to be(false)
|
||||
end
|
||||
|
||||
it "nasconde partita con risultato inserito dal portale anche senza diretta" do
|
||||
match = team.matches.create!(
|
||||
opponent_name: "Squadra 4",
|
||||
scheduled_at: 2.hours.ago,
|
||||
sets_to_win: 3,
|
||||
home_score: 11,
|
||||
away_score: 10,
|
||||
result_status: "played"
|
||||
)
|
||||
|
||||
expect(match.coach_hub_visible?).to be(false)
|
||||
end
|
||||
|
||||
it "nasconde walkover anche se il torneo è ancora aperto" do
|
||||
broadcast = club.teams.create!(
|
||||
name: "Torneo Walkover",
|
||||
sport_key: "pallavolo",
|
||||
internal_kind: Tournament::INTERNAL_TEAM_KIND
|
||||
)
|
||||
tournament = Tournament.create!(
|
||||
club: club,
|
||||
name: "Torneo Walkover",
|
||||
sport_key: "pallavolo",
|
||||
starts_on: Date.current,
|
||||
ends_on: Date.current,
|
||||
format_kind: "free",
|
||||
status: "published",
|
||||
broadcast_team: broadcast
|
||||
)
|
||||
match = broadcast.matches.create!(
|
||||
opponent_name: "TBD",
|
||||
scheduled_at: 1.hour.ago,
|
||||
sets_to_win: 3,
|
||||
tournament: tournament,
|
||||
result_status: "walkover_home",
|
||||
home_score: 1,
|
||||
away_score: 0
|
||||
)
|
||||
|
||||
expect(match.coach_hub_visible?).to be(false)
|
||||
end
|
||||
|
||||
it "mostra partita di oggi già passata d'orario se non è stata trasmessa" do
|
||||
match = team.matches.create!(
|
||||
opponent_name: "Late",
|
||||
|
||||
Reference in New Issue
Block a user