Fix crash e race su +3, layout tabellone con squadre ai lati, safe area in diretta e rimozione overlay cronometro; backend con sync punteggio periodo, link diretta in regia e init score_state basket. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
842 B
Ruby
21 lines
842 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
|
|
RSpec.describe "Api::V1::Sports", type: :request do
|
|
let!(:user) { User.create!(email: "s@example.com", password: "secret123", name: "U", role: "coach") }
|
|
|
|
it "GET /api/v1/sports restituisce il catalogo" do
|
|
post "/api/v1/auth/login", params: { email: user.email, password: "secret123" }
|
|
token = response.parsed_body["access_token"]
|
|
get "/api/v1/sports", headers: { "Authorization" => "Bearer #{token}" }
|
|
expect(response).to have_http_status(:ok)
|
|
body = JSON.parse(response.body)
|
|
expect(body).to be_an(Array)
|
|
pallavolo = body.find { |s| s["key"] == "pallavolo" }
|
|
expect(pallavolo["board"]).to eq("volley")
|
|
expect(pallavolo["allowed_overlays"]).to include("volley", "none")
|
|
expect(pallavolo["allowed_overlays"]).not_to include("timer")
|
|
end
|
|
end
|