bingo: planned status and capacity type
All checks were successful
Build and Deploy to Production / test (push) Successful in 23s
Build and Deploy to Production / build (push) Successful in 1m0s
Build and Deploy to Production / deploy (push) Successful in 39s

"MW" on the card mixed IT load, connected power, total site power,
design capacity and even MVA (Oxygen, Sber Yuzhny Port). Record which
one a figure is in a new mw_type column; the dialog tags the number
("64 MW · design") and MVA replaces the unit, while cells keep the bare
figure to stay readable. Add a "planned" status for projects not yet
under construction; like "building", it is left out of the operational
view.

Assisted-by: Claude:opus-5
This commit is contained in:
Sergei Poljanski 2026-10-10 06:59:04 +04:00
commit e5bd1c1ac7
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
9 changed files with 69 additions and 9 deletions

View file

@ -144,6 +144,30 @@ class BingoTest < Minitest::Test
assert_includes last_response.body, 'index, follow, max-image-preview'
end
def test_capacity_type_and_planned_status
@dcs[0].update(mw: '64', mw_type: 'design', status: 'planned')
@dcs[1].update(mw: '17', mw_type: 'mva')
get '/en'
body = last_response.body
assert_includes body, '64 MW · design' # dialog
assert_includes body, '#1 · 64 MW</div>' # cell: no tag
assert_includes body, '17 MVA'
assert_includes body, '#2 · 17 MVA</div>' # MVA replaces the unit in cells too
assert_includes body, '>planned<'
refute_includes Bingo::Board.load('operational').cells.map(&:slug), 'dc-1'
end
def test_admin_saves_capacity_type_and_planned
@app = AsxpioWeb
token = admin_token("/admin/bingo/dc/#{@dcs[0].id}")
post "/admin/bingo/dc/#{@dcs[0].id}", dc_params(authenticity_token: token, name_ru: 'ЦОД 1', status: 'planned', mw_type: 'connected'), admin_env
@dcs[0].refresh
assert @dcs[0].planned?
assert_equal 'connected', @dcs[0].mw_type
post "/admin/bingo/dc/#{@dcs[0].id}", dc_params(authenticity_token: token, name_ru: 'ЦОД 1', mw_type: 'bogus'), admin_env
assert_nil @dcs[0].refresh.mw_type
end
def test_robots_and_sitemap_are_the_bingos_own
get '/robots.txt'
assert last_response.ok?