Skip to content

Commit

Permalink
fix(docs): 일반 문서 생성 안되는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
NameIsUser06 committed Apr 21, 2024
1 parent 463b7e3 commit d8263f4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private Docs getDocs(String title) {
// given
String name = Arbitraries.strings().ofLength(3).sample();
User user = getSavedUserWithOutThumbsUp(name);
Docs docs = getSavedDocs(name + Arbitraries.strings().ofMinLength(1).ofMaxLength(29).sample());
Docs docs = getSavedNotStudentDocs(name);
String contents = Arbitraries.strings().ofMinLength(1).sample();
VersionDocs versionDocs = getSavedVersionDocs(docs, user);

Expand All @@ -151,9 +151,8 @@ private Docs getDocs(String title) {
void 학생문서_중_본인문서_업데이트_실패() {
// given
String name = Arbitraries.strings().ofLength(3).sample();
Integer enroll = Arbitraries.integers().between(1000, 9999).sample();
User user = getSavedUserWithOutThumbsUp(name, enroll);
Docs docs = getSavedNotStudentDocs(name, enroll);
User user = getSavedUserWithOutThumbsUp(name);
Docs docs = getSavedNotStudentDocs(name);
String contents = Arbitraries.strings().ofMinLength(1).sample();
VersionDocs versionDocs = getSavedVersionDocs(docs, user);

Expand Down Expand Up @@ -284,13 +283,12 @@ private Docs getSavedDocsReadonly() {
);
}

private Docs getSavedNotStudentDocs(String name, Integer enroll) {
private Docs getSavedNotStudentDocs(String name) {
return docsRepository.save(
fixtureGenerator.giveMeBuilder(Docs.class)
.setNull("id")
.setPostCondition("docsType", DocsType.class, (it) -> it != DocsType.STUDENT)
.set("title", name + Arbitraries.strings().ofMinLength(1).ofMaxLength(29).sample())
.set("enroll", enroll)
.sample()
);
}
Expand Down

0 comments on commit d8263f4

Please sign in to comment.