Skip to content

Commit a85694f

Browse files
committed
add test
1 parent df424ee commit a85694f

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

models/fixtures/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,12 @@
6464
repo_id: 1700 # dangling intentional
6565
is_private: false
6666
created_unix: 1603011541
67+
68+
- id: 9
69+
user_id: 34
70+
op_type: 12 # close issue
71+
act_user_id: 34
72+
repo_id: 1 # public
73+
is_private: false
74+
created_unix: 1680454039
75+
content: '4|' # issueId 5

models/fixtures/user.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,3 +1220,40 @@
12201220
repo_admin_change_team_access: false
12211221
theme: ""
12221222
keep_activity_private: false
1223+
1224+
-
1225+
id: 34
1226+
lower_name: the_34-user.with.all.allowedchars
1227+
name: the_34-user.with.all.allowedChars
1228+
full_name: the_1-user.with.all.allowedChars
1229+
1230+
keep_email_private: false
1231+
email_notifications_preference: enabled
1232+
passwd: ZogKvWdyEx:password
1233+
passwd_hash_algo: dummy
1234+
must_change_password: false
1235+
login_source: 0
1236+
login_name: the_34-user.with.all.allowedchars
1237+
type: 0
1238+
salt: ZogKvWdyEx
1239+
max_repo_creation: -1
1240+
is_active: true
1241+
is_admin: false
1242+
is_restricted: false
1243+
allow_git_hook: false
1244+
allow_import_local: false
1245+
allow_create_organization: false
1246+
prohibit_login: false
1247+
avatar: avatar34
1248+
avatar_email: [email protected]
1249+
use_custom_avatar: true
1250+
num_followers: 0
1251+
num_following: 0
1252+
num_stars: 0
1253+
num_repos: 0
1254+
num_teams: 0
1255+
num_members: 0
1256+
visibility: 0
1257+
repo_admin_change_team_access: false
1258+
theme: ""
1259+
keep_activity_private: false

tests/integration/user_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ func testExportUserGPGKeys(t *testing.T, user, expected string) {
241241
assert.Equal(t, expected, resp.Body.String())
242242
}
243243

244+
func TestGetPng(t *testing.T) {
245+
user34 := "the_34-user.with.all.allowedChars"
246+
req := NewRequestf(t, "GET", "/%s.png", user34)
247+
resp := MakeRequest(t, req, http.StatusSeeOther)
248+
assert.EqualValues(t, "/avatars/avatar34", resp.Header().Get("location"))
249+
}
250+
244251
func TestListStopWatches(t *testing.T) {
245252
defer tests.PrepareTestEnv(t)()
246253

0 commit comments

Comments
 (0)