-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from boostcampwm-2024/refactor/repository-reus…
…e-rss ♻️ refactor: rss 도메인 repository 함수 재사용성 향상, 테스트 코드 일관성, 최적화
- Loading branch information
Showing
12 changed files
with
52 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,12 @@ describe('/api/rss E2E Test', () => { | |
describe('POST /api/rss E2E Test', () => { | ||
it('정상적인 요청이 들어왔다면 올바른 응답을 한다.', async () => { | ||
// given | ||
const requestDto = RssRegisterRequestDto.from( | ||
RssFixture.createRssFixture(), | ||
); | ||
const requestDto = new RssRegisterRequestDto({ | ||
blog: 'blog1', | ||
name: 'name1', | ||
email: '[email protected]', | ||
rssUrl: 'https://example1.com/rss', | ||
}); | ||
|
||
// when | ||
const response = await request(app.getHttpServer()) | ||
|
@@ -43,9 +46,12 @@ describe('/api/rss E2E Test', () => { | |
|
||
it('이미 신청한 RSS를 또 신청한다면 거부를 한다.', async () => { | ||
// given | ||
const requestDto = RssRegisterRequestDto.from( | ||
RssFixture.createRssFixture(), | ||
); | ||
const requestDto = new RssRegisterRequestDto({ | ||
blog: 'blog1', | ||
name: 'name1', | ||
email: '[email protected]', | ||
rssUrl: 'https://example1.com/rss', | ||
}); | ||
await request(app.getHttpServer()).post('/api/rss').send(requestDto); | ||
|
||
// when | ||
|
@@ -62,7 +68,12 @@ describe('/api/rss E2E Test', () => { | |
const acceptedRss = await rssAcceptRepository.save( | ||
RssAcceptFixture.createRssAcceptFixture(), | ||
); | ||
const rssRegisterDto = RssRegisterRequestDto.from(acceptedRss); | ||
const rssRegisterDto = new RssRegisterRequestDto({ | ||
blog: acceptedRss.name, | ||
name: acceptedRss.userName, | ||
email: acceptedRss.email, | ||
rssUrl: acceptedRss.rssUrl, | ||
}); | ||
|
||
// when | ||
const response = await request(app.getHttpServer()) | ||
|
@@ -85,8 +96,9 @@ describe('/api/rss E2E Test', () => { | |
|
||
it('등록된 RSS가 존재할 경우 해당 데이터를 반환한다.', async () => { | ||
// given | ||
const rss = RssFixture.createRssFixture(); | ||
const expectedResult = await rssRepository.save(rss); | ||
const expectedResult = await rssRepository.save( | ||
RssFixture.createRssFixture(), | ||
); | ||
|
||
// when | ||
const response = await request(app.getHttpServer()).get('/api/rss'); | ||
|