Dirette: nasconde partite programmate nel passato.
La pagina /live mostrava tutte le partite da inizio giornata; ora solo con orario futuro. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
16
backend/spec/models/match_scheduling_spec.rb
Normal file
16
backend/spec/models/match_scheduling_spec.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Match, "scheduling scopes" do
|
||||
let!(:club) do
|
||||
Club.create!(name: "Sched Club", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff")
|
||||
end
|
||||
let!(:team) { club.teams.create!(name: "U16", sport: "volleyball") }
|
||||
|
||||
it "scheduled_for_live esclude partite già passate oggi" do
|
||||
past = team.matches.create!(opponent_name: "Past", scheduled_at: 2.hours.ago, sets_to_win: 3)
|
||||
future = team.matches.create!(opponent_name: "Future", scheduled_at: 2.hours.from_now, sets_to_win: 3)
|
||||
|
||||
expect(described_class.scheduled_for_live).to include(future)
|
||||
expect(described_class.scheduled_for_live).not_to include(past)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user