Allinea i form società/squadra al catalogo sport, espone score_action per basket/timed e corregge bug namespace Sports e Result nel period engine; l'app nativa gestisce overlay e punteggio per board con wizard regole esteso. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
940 B
Ruby
32 lines
940 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
|
|
RSpec.describe Sports::Catalog do
|
|
describe ".find" do
|
|
it "restituisce pallavolo con board volley" do
|
|
entry = described_class.find("pallavolo")
|
|
expect(entry[:board]).to eq("volley")
|
|
expect(entry[:overlay]).to eq("volley")
|
|
expect(entry[:default_rules][:sets_to_win]).to eq(3)
|
|
end
|
|
|
|
it "mappa legacy volleyball" do
|
|
expect(described_class.normalize_key("volleyball")).to eq("pallavolo")
|
|
end
|
|
|
|
it "altro usa board generic" do
|
|
entry = described_class.find("altro")
|
|
expect(entry[:board]).to eq("generic")
|
|
expect(entry[:overlay]).to eq("none")
|
|
end
|
|
end
|
|
|
|
describe ".as_api_list" do
|
|
it "include tutti gli sport configurati" do
|
|
keys = described_class.as_api_list.map { |e| e[:key] }
|
|
expect(keys).to include("pallavolo", "basket", "calcio_a_5", "tennis", "ginnastica_artistica", "altro")
|
|
end
|
|
end
|
|
end
|