require "rails_helper" RSpec.describe "Public support page", type: :request do it "รจ pubblica, indicizzabile e mostra l'email di supporto configurata" do get public_support_path expect(response).to have_http_status(:ok) expect(response.body).to include(MatchLiveTv.support_email) expect(response.body).to include("mailto:#{MatchLiveTv.support_email}") expect(response.body).to include(I18n.t("legal.support.h1", locale: :it)) expect(response.body).to include('rel="canonical"') expect(response.body).to include(public_support_path) expect(response.body).to include(public_privacy_path) end it "non espone CTA o link commerciali (App Store Review)" do get public_support_path body = response.body expect(body).not_to include(public_prezzi_path) expect(body).not_to include(public_signup_path) expect(body).not_to include('href="/prezzi"') expect(body).not_to include('href="/signup"') expect(body).not_to include(I18n.t("nav.signup", locale: :it)) expect(body).not_to include(I18n.t("nav.pricing", locale: :it)) expect(body).not_to include(I18n.t("common.pricing", locale: :it)) expect(body).not_to match(/\bPremium Light\b/i) expect(body).not_to match(/\bPremium Full\b/i) expect(body).not_to match(/\bpiano Free\b/i) expect(body).not_to match(/\bAbbonati\b/i) expect(body).not_to match(/\bAcquista\b/i) end { "it" => "Supporto Match Live TV", "en" => "Match Live TV Support", "fr" => "Support Match Live TV", "de" => "Match Live TV Support", "es" => "Soporte Match Live TV" }.each do |locale, heading| it "renderizza correttamente in #{locale} senza translation missing" do cookies[:mltv_locale] = locale get public_support_path expect(response).to have_http_status(:ok) expect(response.body).to include(heading) expect(response.body).not_to include("translation missing") end end it "include /support nella sitemap" do get "/sitemap.xml" expect(response).to have_http_status(:ok) expect(response.body).to include("#{MatchLiveTv.app_public_url.chomp('/')}/support") end end