Skip to content

Commit

Permalink
実装+テスト修正 (不要と思われる改行削除)
Browse files Browse the repository at this point in the history
  • Loading branch information
hattorihotaka committed Feb 21, 2023
1 parent f2788dd commit 580885c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/internal/domain/service/slack_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func (s *slackResponseService) ReplyEmailList(ctx context.Context, event *slacke
if len(emails) <= lineSizeOfPostEmailList-1 {
var b strings.Builder
b.Grow(len(emails) + 1)
b.WriteString("参加者一覧\n")
b.WriteString("参加者一覧")
for _, email := range emails {
b.WriteString(email.Email)
b.WriteString("\n" + email.Email)
}
return s.slackRepository.PostMessage(ctx, event.Channel, b.String(), event.ThreadTimeStamp)
}
Expand Down
4 changes: 2 additions & 2 deletions app/internal/domain/service/slack_response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func Test_slackErrorResponseService_ReplyEmailList(t *testing.T) {
},
prepare: func(msr *mock_repository.MockSlackRepository) {
msr.EXPECT().PostMessage(gomock.Any(), "sampleChannel",
"参加者一覧\n[email protected]\n[email protected]\n",
"参加者一覧\n[email protected]\n[email protected]",
"sampleThreadTimeStamp").Return(nil)
},
},
Expand All @@ -175,7 +175,7 @@ func Test_slackErrorResponseService_ReplyEmailList(t *testing.T) {
},
prepare: func(msr *mock_repository.MockSlackRepository) {
msr.EXPECT().PostMessage(gomock.Any(), "sampleChannel",
"参加者一覧\n[email protected]\n[email protected]\n",
"参加者一覧\n[email protected]\n[email protected]",
"sampleThreadTimeStamp").Return(errors.New("sample error"))
},
wantErr: true,
Expand Down

0 comments on commit 580885c

Please sign in to comment.