@@ -29,23 +29,23 @@ func TestGetAppearance(t *testing.T) {
29
29
mux .HandleFunc ("/api/v4/application/appearance" , func (w http.ResponseWriter , r * http.Request ) {
30
30
testMethod (t , r , http .MethodGet )
31
31
fmt .Fprint (w , `{
32
- "title": "GitLab Test Instance",
33
- "description": "gitlab-test.example.com",
34
- "pwa_name": "GitLab PWA",
35
- "pwa_short_name": "GitLab",
36
- "pwa_description": "GitLab as PWA",
37
- "pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
38
- "logo": "/uploads/-/system/appearance/logo/1/logo.png",
39
- "header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
40
- "favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
41
- "new_project_guidelines": "Please read the FAQs for help.",
42
- "profile_image_guidelines": "Custom profile image guidelines",
43
- "header_message": "",
44
- "footer_message": "",
45
- "message_background_color": "#e75e40",
46
- "message_font_color": "#ffffff",
47
- "email_header_and_footer_enabled": false
48
- }` )
32
+ "title": "GitLab Test Instance",
33
+ "description": "gitlab-test.example.com",
34
+ "pwa_name": "GitLab PWA",
35
+ "pwa_short_name": "GitLab",
36
+ "pwa_description": "GitLab as PWA",
37
+ "pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
38
+ "logo": "/uploads/-/system/appearance/logo/1/logo.png",
39
+ "header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
40
+ "favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
41
+ "new_project_guidelines": "Please read the FAQs for help.",
42
+ "profile_image_guidelines": "Custom profile image guidelines",
43
+ "header_message": "",
44
+ "footer_message": "",
45
+ "message_background_color": "#e75e40",
46
+ "message_font_color": "#ffffff",
47
+ "email_header_and_footer_enabled": false
48
+ }` )
49
49
})
50
50
51
51
appearance , _ , err := client .Appearance .GetAppearance ()
@@ -56,10 +56,10 @@ func TestGetAppearance(t *testing.T) {
56
56
want := & Appearance {
57
57
Title : "GitLab Test Instance" ,
58
58
Description : "gitlab-test.example.com" ,
59
- PwaName : "GitLab PWA" ,
60
- PwaShortName : "GitLab" ,
61
- PwaDescription : "GitLab as PWA" ,
62
- PwaIcon : "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png" ,
59
+ PWAName : "GitLab PWA" ,
60
+ PWAShortName : "GitLab" ,
61
+ PWADescription : "GitLab as PWA" ,
62
+ PWAIcon : "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png" ,
63
63
Logo : "/uploads/-/system/appearance/logo/1/logo.png" ,
64
64
HeaderLogo : "/uploads/-/system/appearance/header_logo/1/header.png" ,
65
65
Favicon : "/uploads/-/system/appearance/favicon/1/favicon.png" ,
@@ -77,62 +77,62 @@ func TestGetAppearance(t *testing.T) {
77
77
}
78
78
}
79
79
80
- func TestPutAppearance (t * testing.T ) {
80
+ func TestChangeAppearance (t * testing.T ) {
81
81
mux , client := setup (t )
82
82
83
83
mux .HandleFunc ("/api/v4/application/appearance" , func (w http.ResponseWriter , r * http.Request ) {
84
84
testMethod (t , r , http .MethodPut )
85
85
fmt .Fprint (w , `{
86
- "title": "GitLab Test Instance - 001",
87
- "description": "gitlab-test.example.com",
88
- "pwa_name": "GitLab PWA",
89
- "pwa_short_name": "GitLab",
90
- "pwa_description": "GitLab as PWA",
91
- "pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
92
- "logo": "/uploads/-/system/appearance/logo/1/logo.png",
93
- "header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
94
- "favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
95
- "new_project_guidelines": "Please read the FAQs for help.",
96
- "profile_image_guidelines": "Custom profile image guidelines",
97
- "header_message": "",
98
- "footer_message": "",
99
- "message_background_color": "#e75e40",
100
- "message_font_color": "#ffffff",
101
- "email_header_and_footer_enabled": false
102
- }` )
86
+ "title": "GitLab Test Instance - 001",
87
+ "description": "gitlab-test.example.com",
88
+ "pwa_name": "GitLab PWA",
89
+ "pwa_short_name": "GitLab",
90
+ "pwa_description": "GitLab as PWA",
91
+ "pwa_icon": "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png",
92
+ "logo": "/uploads/-/system/appearance/logo/1/logo.png",
93
+ "header_logo": "/uploads/-/system/appearance/header_logo/1/header.png",
94
+ "favicon": "/uploads/-/system/appearance/favicon/1/favicon.png",
95
+ "new_project_guidelines": "Please read the FAQs for help.",
96
+ "profile_image_guidelines": "Custom profile image guidelines",
97
+ "header_message": "",
98
+ "footer_message": "",
99
+ "message_background_color": "#e75e40",
100
+ "message_font_color": "#ffffff",
101
+ "email_header_and_footer_enabled": false
102
+ }` )
103
103
})
104
104
105
- opt := & PutAppearanceRequestOptions {
106
- Title : "GitLab Test Instance - 001" ,
107
- Description : "gitlab-test.example.com" ,
108
- PwaName : "GitLab PWA" ,
109
- PwaShortName : "GitLab" ,
110
- PwaDescription : "GitLab as PWA" ,
111
- PwaIcon : "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png" ,
112
- Logo : "/uploads/-/system/appearance/logo/1/logo.png" ,
113
- HeaderLogo : "/uploads/-/system/appearance/header_logo/1/header.png" ,
114
- Favicon : "/uploads/-/system/appearance/favicon/1/favicon.png" ,
115
- NewProjectGuidelines : "Please read the FAQs for help." ,
116
- ProfileImageGuidelines : "Custom profile image guidelines" ,
117
- HeaderMessage : "" ,
118
- FooterMessage : "" ,
119
- MessageBackgroundColor : "#e75e40" ,
120
- MessageFontColor : "#ffffff" ,
121
- EmailHeaderAndFooterEnabled : false ,
105
+ opt := & ChangeAppearanceOptions {
106
+ Title : String ( "GitLab Test Instance - 001" ) ,
107
+ Description : String ( "gitlab-test.example.com" ) ,
108
+ PWAName : String ( "GitLab PWA" ) ,
109
+ PWAShortName : String ( "GitLab" ) ,
110
+ PWADescription : String ( "GitLab as PWA" ) ,
111
+ PWAIcon : String ( "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png" ) ,
112
+ Logo : String ( "/uploads/-/system/appearance/logo/1/logo.png" ) ,
113
+ HeaderLogo : String ( "/uploads/-/system/appearance/header_logo/1/header.png" ) ,
114
+ Favicon : String ( "/uploads/-/system/appearance/favicon/1/favicon.png" ) ,
115
+ NewProjectGuidelines : String ( "Please read the FAQs for help." ) ,
116
+ ProfileImageGuidelines : String ( "Custom profile image guidelines" ) ,
117
+ HeaderMessage : String ( "" ) ,
118
+ FooterMessage : String ( "" ) ,
119
+ MessageBackgroundColor : String ( "#e75e40" ) ,
120
+ MessageFontColor : String ( "#ffffff" ) ,
121
+ EmailHeaderAndFooterEnabled : Bool ( false ) ,
122
122
}
123
123
124
- appearance , _ , err := client .Appearance .PutAppearance (opt )
124
+ appearance , _ , err := client .Appearance .ChangeAppearance (opt )
125
125
if err != nil {
126
- t .Errorf ("Appearance.GetAppearance returned error: %v" , err )
126
+ t .Errorf ("Appearance.ChangeAppearance returned error: %v" , err )
127
127
}
128
128
129
129
want := & Appearance {
130
130
Title : "GitLab Test Instance - 001" ,
131
131
Description : "gitlab-test.example.com" ,
132
- PwaName : "GitLab PWA" ,
133
- PwaShortName : "GitLab" ,
134
- PwaDescription : "GitLab as PWA" ,
135
- PwaIcon : "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png" ,
132
+ PWAName : "GitLab PWA" ,
133
+ PWAShortName : "GitLab" ,
134
+ PWADescription : "GitLab as PWA" ,
135
+ PWAIcon : "/uploads/-/system/appearance/pwa_icon/1/pwa_logo.png" ,
136
136
Logo : "/uploads/-/system/appearance/logo/1/logo.png" ,
137
137
HeaderLogo : "/uploads/-/system/appearance/header_logo/1/header.png" ,
138
138
Favicon : "/uploads/-/system/appearance/favicon/1/favicon.png" ,
0 commit comments