Skip to content

Commit

Permalink
feat: 토론 테이블 이름에 숫자도 허용하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
leegwichan committed Jan 24, 2025
1 parent 4321446 commit c20be30
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ParliamentaryTable {

private static final String NAME_REGEX = "^[a-zA-Z가- ]+$";
private static final String NAME_REGEX = "^[a-zA-Z가-힣0-9 ]+$";
public static final int NAME_MAX_LENGTH = 20;

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum ClientErrorCode implements ErrorCode {
),
INVALID_TABLE_NAME_FORM(
HttpStatus.BAD_REQUEST,
"테이블 이름은 영문/한글만 가능합니다"
"테이블 이름은 영문/한글/숫자/띄어쓰기만 가능합니다"
),
INVALID_TABLE_TIME(HttpStatus.BAD_REQUEST, "시간은 양수만 가능합니다"),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class ParliamentaryTableTest {
class Validate {

@ParameterizedTest
@ValueSource(strings = {"a bc가다", "가나 다ab"})
void 테이블_이름은_영문과_한글_띄어쓰기만_가능하다(String name) {
@ValueSource(strings = {"a bc가다9", "가0나 다ab"})
void 테이블_이름은_영문과_한글_숫자_띄어쓰기만_가능하다(String name) {
Member member = new Member("member");
assertThatCode(() -> new ParliamentaryTable(member, name, "agenda", 10))
.doesNotThrowAnyException();
Expand All @@ -42,7 +42,7 @@ class Validate {
}

@ParameterizedTest
@ValueSource(strings = {"abc12", "가나다12", "abc\tde"})
@ValueSource(strings = {"abc@", "가나다*", "abc\tde"})
void 허용된_글자_이외의_문자는_불가능하다(String name) {
Member member = new Member("member");
assertThatThrownBy(() -> new ParliamentaryTable(member, name, "agenda", 10))
Expand Down

0 comments on commit c20be30

Please sign in to comment.