Limita una diretta attiva per account e valorizza la copertina Premium Full.
Blocca la seconda diretta sullo stesso utente, registra gli abusi in admin e presenta la copertina come grafica caricata dalla società, con demo Team MLTV. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe "Public team page", type: :request do
|
||||
let(:club) { Club.create!(name: "ASD Eagles", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
|
||||
let(:club) { Club.create!(name: "Team MLTV", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
|
||||
let!(:team) do
|
||||
club.teams.create!(
|
||||
name: "Tigers Volley U17",
|
||||
name: "Team MLTV U15",
|
||||
sport_key: "pallavolo",
|
||||
description: "Squadra giovanile under 17.",
|
||||
description: "Squadra giovanile under 15.",
|
||||
roster_public: true
|
||||
)
|
||||
end
|
||||
@@ -15,9 +15,9 @@ RSpec.describe "Public team page", type: :request do
|
||||
get public_team_page_path(team.slug)
|
||||
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.body).to include("Tigers Volley U17")
|
||||
expect(response.body).to include("ASD Eagles")
|
||||
expect(response.body).to include("Squadra giovanile under 17")
|
||||
expect(response.body).to include("Team MLTV U15")
|
||||
expect(response.body).to include("Team MLTV")
|
||||
expect(response.body).to include("Squadra giovanile under 15")
|
||||
end
|
||||
|
||||
it "restituisce 404 per slug inesistente" do
|
||||
@@ -41,13 +41,13 @@ RSpec.describe "Public team page", type: :request do
|
||||
end
|
||||
|
||||
RSpec.describe "Public team directory", type: :request do
|
||||
let(:club) { Club.create!(name: "ASD Eagles", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
|
||||
let(:club) { Club.create!(name: "Team MLTV", sport: "volleyball", primary_color: "#e53935", secondary_color: "#ffffff") }
|
||||
let(:user) { User.create!(email: "dir2@test.com", name: "Coach", password: "Password123", role: "coach") }
|
||||
let!(:team) { club.teams.create!(name: "Tigers Volley U17", sport_key: "pallavolo") }
|
||||
let!(:team) { club.teams.create!(name: "Team MLTV U15", sport_key: "pallavolo") }
|
||||
|
||||
before do
|
||||
club.club_memberships.create!(user: user, role: "owner")
|
||||
match = team.matches.create!(opponent_name: "Rival", sport_key: "pallavolo", scheduled_at: 1.day.from_now)
|
||||
match = team.matches.create!(opponent_name: MatchLiveTv::Demo::AWAY_TEAM, sport_key: "pallavolo", scheduled_at: 1.day.from_now)
|
||||
StreamSession.create!(
|
||||
match: match, user: user, status: "live", platform: "matchlivetv",
|
||||
privacy_status: "public", publish_token: "tok-dir", started_at: Time.current
|
||||
@@ -58,13 +58,13 @@ RSpec.describe "Public team directory", type: :request do
|
||||
get public_team_pages_path
|
||||
|
||||
expect(response).to have_http_status(:ok)
|
||||
expect(response.body).to include("Tigers Volley U17")
|
||||
expect(response.body).to include("Team MLTV U15")
|
||||
expect(response.body).to include("In diretta")
|
||||
end
|
||||
|
||||
it "filtra per sport via query string" do
|
||||
get public_team_pages_path(sport: "basket")
|
||||
|
||||
expect(response.body).not_to include("Tigers Volley U17")
|
||||
expect(response.body).not_to include("Team MLTV U15")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user