File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -119,5 +119,27 @@ func TestCollaborationPost_InactiveUser(t *testing.T) {
119
119
120
120
assert .EqualValues (t , http .StatusFound , ctx .Resp .Status ())
121
121
assert .NotEmpty (t , ctx .Flash .ErrorMsg )
122
+ }
123
+
124
+ func TestCollaborationPost_NonExistentUser (t * testing.T ) {
125
+
126
+ models .PrepareTestEnv (t )
127
+ ctx := test .MockContext (t , "user2/repo1/issues/labels" )
128
+ test .LoadUser (t , ctx , 2 )
129
+ test .LoadRepo (t , ctx , 1 )
130
+
131
+ ctx .Req .Form .Set ("collaborator" , "user34" )
132
+
133
+ repo := & context.Repository {
134
+ Owner : & models.User {
135
+ LowerName : "user2" ,
136
+ },
137
+ }
138
+
139
+ ctx .Repo = repo
140
+
141
+ CollaborationPost (ctx )
122
142
143
+ assert .EqualValues (t , http .StatusFound , ctx .Resp .Status ())
144
+ assert .NotEmpty (t , ctx .Flash .ErrorMsg )
123
145
}
You can’t perform that action at this time.
0 commit comments