bingo: optional prose per datacenter page

The datacenter pages carry only generated sentences, which is thin
content to rank on. Migration 015 adds about_ru/en/uk, edited in the
admin form and rendered as paragraphs below the facts.

There is deliberately no fallback to ru: Russian prose on the English
page would hurt more than an absent paragraph.

Assisted-by: Claude:opus-5
This commit is contained in:
Sergei Poljanski 2026-10-10 09:41:11 +04:00
commit ca48f4292b
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
6 changed files with 27 additions and 1 deletions

View file

@ -252,6 +252,16 @@ class BingoTest < Minitest::Test
refute_includes last_response.body, 'rel="prev"'
end
def test_dc_about_text
@app = AsxpioWeb
token = admin_token("/admin/bingo/dc/#{@dcs[1].id}")
post "/admin/bingo/dc/#{@dcs[1].id}", dc_params(authenticity_token: token, about_en: "First <b>para</b>.\r\n\r\nSecond."), admin_env
assert_equal "First <b>para</b>.\r\n\r\nSecond.", @dcs[1].refresh.about_en
public = Rack::MockRequest.new(BingoWeb) # rack-test's session is bound to AsxpioWeb now
assert_includes public.get('/en/dc/dc-2').body, '<p class="facts">First &lt;b&gt;para&lt;/b&gt;.</p><p class="facts">Second.</p>'
refute_includes public.get('/ru/dc/dc-2').body, 'Second.' # no fallback across languages
end
def test_reserve_dc_has_a_page
Bingo::Datacenter.create(slug: 'dc-26', position: 26, name_ru: 'ЦОД 26', city_ru: 'Тверь', operator: 'Op')
get '/ru/dc/dc-26'