@@ -83,7 +83,7 @@ func TestComposeIssueCommentMessage(t *testing.T) {
83
83
bodyTemplates = template .Must (template .New ("issue/comment" ).Parse (bodyTpl ))
84
84
85
85
recipients := []* user_model.User {{Name : "Test" , Email : "test@gitea.com" }, {Name : "Test2" , Email : "test2@gitea.com" }}
86
- msgs , err := composeIssueCommentMessages (& mailCommentContext {
86
+ msgs , err := composeIssueCommentMessages (& MailCommentContext {
87
87
Context : context .TODO (), // TODO: use a correct context
88
88
Issue : issue , Doer : doer , ActionType : activities_model .ActionCommentIssue ,
89
89
Content : fmt .Sprintf ("test @%s %s#%d body" , doer .Name , issue .Repo .FullName (), issue .Index ),
@@ -129,7 +129,7 @@ func TestComposeIssueMessage(t *testing.T) {
129
129
bodyTemplates = template .Must (template .New ("issue/new" ).Parse (bodyTpl ))
130
130
131
131
recipients := []* user_model.User {{Name : "Test" , Email : "test@gitea.com" }, {Name : "Test2" , Email : "test2@gitea.com" }}
132
- msgs , err := composeIssueCommentMessages (& mailCommentContext {
132
+ msgs , err := composeIssueCommentMessages (& MailCommentContext {
133
133
Context : context .TODO (), // TODO: use a correct context
134
134
Issue : issue , Doer : doer , ActionType : activities_model .ActionCreateIssue ,
135
135
Content : "test body" ,
@@ -176,14 +176,14 @@ func TestTemplateSelection(t *testing.T) {
176
176
assert .Contains (t , wholemsg , expBody )
177
177
}
178
178
179
- msg := testComposeIssueCommentMessage (t , & mailCommentContext {
179
+ msg := testComposeIssueCommentMessage (t , & MailCommentContext {
180
180
Context : context .TODO (), // TODO: use a correct context
181
181
Issue : issue , Doer : doer , ActionType : activities_model .ActionCreateIssue ,
182
182
Content : "test body" ,
183
183
}, recipients , false , "TestTemplateSelection" )
184
184
expect (t , msg , "issue/new/subject" , "issue/new/body" )
185
185
186
- msg = testComposeIssueCommentMessage (t , & mailCommentContext {
186
+ msg = testComposeIssueCommentMessage (t , & MailCommentContext {
187
187
Context : context .TODO (), // TODO: use a correct context
188
188
Issue : issue , Doer : doer , ActionType : activities_model .ActionCommentIssue ,
189
189
Content : "test body" , Comment : comment ,
@@ -192,14 +192,14 @@ func TestTemplateSelection(t *testing.T) {
192
192
193
193
pull := unittest .AssertExistsAndLoadBean (t , & issues_model.Issue {ID : 2 , Repo : repo , Poster : doer })
194
194
comment = unittest .AssertExistsAndLoadBean (t , & issues_model.Comment {ID : 4 , Issue : pull })
195
- msg = testComposeIssueCommentMessage (t , & mailCommentContext {
195
+ msg = testComposeIssueCommentMessage (t , & MailCommentContext {
196
196
Context : context .TODO (), // TODO: use a correct context
197
197
Issue : pull , Doer : doer , ActionType : activities_model .ActionCommentPull ,
198
198
Content : "test body" , Comment : comment ,
199
199
}, recipients , false , "TestTemplateSelection" )
200
200
expect (t , msg , "pull/comment/subject" , "pull/comment/body" )
201
201
202
- msg = testComposeIssueCommentMessage (t , & mailCommentContext {
202
+ msg = testComposeIssueCommentMessage (t , & MailCommentContext {
203
203
Context : context .TODO (), // TODO: use a correct context
204
204
Issue : issue , Doer : doer , ActionType : activities_model .ActionCloseIssue ,
205
205
Content : "test body" , Comment : comment ,
@@ -218,7 +218,7 @@ func TestTemplateServices(t *testing.T) {
218
218
bodyTemplates = template .Must (template .New ("issue/default" ).Parse (tplBody ))
219
219
220
220
recipients := []* user_model.User {{Name : "Test" , Email : "test@gitea.com" }}
221
- msg := testComposeIssueCommentMessage (t , & mailCommentContext {
221
+ msg := testComposeIssueCommentMessage (t , & MailCommentContext {
222
222
Context : context .TODO (), // TODO: use a correct context
223
223
Issue : issue , Doer : doer , ActionType : actionType ,
224
224
Content : "test body" , Comment : comment ,
@@ -252,7 +252,7 @@ func TestTemplateServices(t *testing.T) {
252
252
"//Re: //" )
253
253
}
254
254
255
- func testComposeIssueCommentMessage (t * testing.T , ctx * mailCommentContext , recipients []* user_model.User , fromMention bool , info string ) * Message {
255
+ func testComposeIssueCommentMessage (t * testing.T , ctx * MailCommentContext , recipients []* user_model.User , fromMention bool , info string ) * Message {
256
256
msgs , err := composeIssueCommentMessages (ctx , "en-US" , recipients , fromMention , info )
257
257
assert .NoError (t , err )
258
258
assert .Len (t , msgs , 1 )
@@ -262,7 +262,7 @@ func testComposeIssueCommentMessage(t *testing.T, ctx *mailCommentContext, recip
262
262
func TestGenerateAdditionalHeaders (t * testing.T ) {
263
263
doer , _ , issue , _ := prepareMailerTest (t )
264
264
265
- ctx := & mailCommentContext {Context : context .TODO () /* TODO: use a correct context */ , Issue : issue , Doer : doer }
265
+ ctx := & MailCommentContext {Context : context .TODO () /* TODO: use a correct context */ , Issue : issue , Doer : doer }
266
266
recipient := & user_model.User {Name : "test" , Email : "test@gitea.com" }
267
267
268
268
headers := generateAdditionalHeaders (ctx , "dummy-reason" , recipient )
0 commit comments