Introduce architettura multi-sport con catalogo, engine scoring e overlay.
Catalogo sport in YAML, board implicito, engine per volley/basket/timed/racket/timer/generic, regia e app Android allineate. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
18
backend/spec/services/scoring/generic_engine_spec.rb
Normal file
18
backend/spec/services/scoring/generic_engine_spec.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe Scoring::Engines::GenericEngine do
|
||||
let!(:club) { Club.create!(name: "C", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
|
||||
let!(:team) { club.teams.create!(name: "T", sport: "altro") }
|
||||
let!(:match) { team.matches.create!(opponent_name: "Opp", sport: "altro") }
|
||||
let!(:user) { User.create!(email: "g@example.com", password: "secret123", name: "Coach") }
|
||||
let!(:session) { StreamSession.create!(match: match, user: user, status: "live", platform: "matchlivetv") }
|
||||
|
||||
it "incrementa solo il contatore senza chiudere set" do
|
||||
engine = described_class.new(match: match)
|
||||
result = engine.apply(session: session, action: "home_point")
|
||||
expect(result.score.home_points).to eq(1)
|
||||
expect(result.set_won).to be(false)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user