From 09dbd6b92c1ac6f3f6886be23f206a43fc398bca Mon Sep 17 00:00:00 2001 From: Joshua Augustinus Date: Thu, 13 Jun 2024 16:55:33 +1000 Subject: [PATCH] Better restrictions titles --- lib/teiserver/lobby/libs/lobby_restrictions.ex | 2 +- test/teiserver/battle/lobby_server_test.exs | 4 ++-- test/teiserver/lobby/libs/lobby_restrictions_test.exs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/teiserver/lobby/libs/lobby_restrictions.ex b/lib/teiserver/lobby/libs/lobby_restrictions.ex index 73098e387..92240799f 100644 --- a/lib/teiserver/lobby/libs/lobby_restrictions.ex +++ b/lib/teiserver/lobby/libs/lobby_restrictions.ex @@ -91,7 +91,7 @@ defmodule Teiserver.Lobby.LobbyRestrictions do # Rating range max_rating_to_play < @rating_upper_bound || min_rating_to_play > 0 -> - "Rating between: #{min_rating_to_play} - #{max_rating_to_play}" + "Rating: #{min_rating_to_play}-#{max_rating_to_play}" true -> nil diff --git a/test/teiserver/battle/lobby_server_test.exs b/test/teiserver/battle/lobby_server_test.exs index 159a5101b..67f4a00f2 100644 --- a/test/teiserver/battle/lobby_server_test.exs +++ b/test/teiserver/battle/lobby_server_test.exs @@ -112,12 +112,12 @@ defmodule Teiserver.Battle.LobbyServerTest do c = LobbyLib.call_lobby(lobby_id, :get_lobby_state) assert c.id == lobby_id - assert c.name == "base name | Rating between: 10 - 50" + assert c.name == "base name | Rating: 10-50" # Try renaming with nil user LobbyLib.rename_lobby(lobby_id, "other name", nil) c = LobbyLib.call_lobby(lobby_id, :get_lobby_state) assert c.id == lobby_id - assert c.name == "other name | Rating between: 10 - 50" + assert c.name == "other name | Rating: 10-50" end end diff --git a/test/teiserver/lobby/libs/lobby_restrictions_test.exs b/test/teiserver/lobby/libs/lobby_restrictions_test.exs index ec6c10f85..b0256a180 100644 --- a/test/teiserver/lobby/libs/lobby_restrictions_test.exs +++ b/test/teiserver/lobby/libs/lobby_restrictions_test.exs @@ -48,6 +48,6 @@ defmodule Teiserver.Lobby.Libs.LobbyRestrictionsTest do maximum_rating_to_play: 20 }) - assert result == "Rating between: 4 - 20" + assert result == "Rating: 4-20" end end