Skip to content

Commit

Permalink
Merge pull request #330 from jauggy/jauggy/better-restriction-titles
Browse files Browse the repository at this point in the history
Better restrictions titles
  • Loading branch information
L-e-x-o-n authored Jul 9, 2024
2 parents acc8b94 + 09dbd6b commit fdb31fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/teiserver/lobby/libs/lobby_restrictions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/teiserver/battle/lobby_server_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/teiserver/lobby/libs/lobby_restrictions_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fdb31fa

Please sign in to comment.