@@ -14,15 +14,29 @@ func TestListGroupWikis(t *testing.T) {
1414 mux .HandleFunc ("/api/v4/groups/1/wikis" ,
1515 func (w http.ResponseWriter , r * http.Request ) {
1616 testMethod (t , r , http .MethodGet )
17- fmt .Fprint (w , `[{"content":"content here","format":"markdown","slug":"deploy","title":"deploy title"}]` )
17+ fmt .Fprint (w , `[
18+ {
19+ "content": "content here",
20+ "format": "markdown",
21+ "slug": "deploy",
22+ "title": "deploy title"
23+ }
24+ ]` )
1825 })
1926
2027 groupwikis , _ , err := client .GroupWikis .ListGroupWikis (1 , & ListGroupWikisOptions {})
2128 if err != nil {
2229 t .Errorf ("GroupWikis.ListGroupWikis returned error: %v" , err )
2330 }
2431
25- want := []* GroupWiki {{Content : "content here" , Format : WikiFormatMarkdown , Slug : "deploy" , Title : "deploy title" }}
32+ want := []* GroupWiki {
33+ {
34+ Content : "content here" ,
35+ Format : WikiFormatMarkdown ,
36+ Slug : "deploy" ,
37+ Title : "deploy title" ,
38+ },
39+ }
2640 if ! reflect .DeepEqual (want , groupwikis ) {
2741 t .Errorf ("GroupWikis.ListGroupWikis returned %+v, want %+v" , groupwikis , want )
2842 }
@@ -35,15 +49,27 @@ func TestGetGroupWikiPage(t *testing.T) {
3549 mux .HandleFunc ("/api/v4/groups/1/wikis/deploy" ,
3650 func (w http.ResponseWriter , r * http.Request ) {
3751 testMethod (t , r , http .MethodGet )
38- fmt .Fprint (w , `{"content":"content here","format":"asciidoc","slug":"deploy","title":"deploy title"}` )
52+ fmt .Fprint (w , `{
53+ "content": "content here",
54+ "format": "asciidoc",
55+ "slug": "deploy",
56+ "title": "deploy title",
57+ "encoding": "UTF-8"
58+ }` )
3959 })
4060
41- groupwiki , _ , err := client .GroupWikis .GetGroupWikiPage (1 , "deploy" )
61+ groupwiki , _ , err := client .GroupWikis .GetGroupWikiPage (1 , "deploy" , & GetGroupWikiPageOptions {} )
4262 if err != nil {
4363 t .Errorf ("GroupWikis.GetGroupWikiPage returned error: %v" , err )
4464 }
4565
46- want := & GroupWiki {Content : "content here" , Format : WikiFormatASCIIDoc , Slug : "deploy" , Title : "deploy title" }
66+ want := & GroupWiki {
67+ Content : "content here" ,
68+ Encoding : "UTF-8" ,
69+ Format : WikiFormatASCIIDoc ,
70+ Slug : "deploy" ,
71+ Title : "deploy title" ,
72+ }
4773 if ! reflect .DeepEqual (want , groupwiki ) {
4874 t .Errorf ("GroupWikis.GetGroupWikiPage returned %+v, want %+v" , groupwiki , want )
4975 }
@@ -56,7 +82,12 @@ func TestCreateGroupWikiPage(t *testing.T) {
5682 mux .HandleFunc ("/api/v4/groups/1/wikis" ,
5783 func (w http.ResponseWriter , r * http.Request ) {
5884 testMethod (t , r , http .MethodPost )
59- fmt .Fprint (w , `{"content":"content here","format":"rdoc","slug":"deploy","title":"deploy title"}` )
85+ fmt .Fprint (w , `{
86+ "content": "content here",
87+ "format": "rdoc",
88+ "slug": "deploy",
89+ "title": "deploy title"
90+ }` )
6091 })
6192
6293 groupwiki , _ , err := client .GroupWikis .CreateGroupWikiPage (1 , & CreateGroupWikiPageOptions {
@@ -68,7 +99,12 @@ func TestCreateGroupWikiPage(t *testing.T) {
6899 t .Errorf ("GroupWikis.CreateGroupWikiPage returned error: %v" , err )
69100 }
70101
71- want := & GroupWiki {Content : "content here" , Format : WikiFormatRDoc , Slug : "deploy" , Title : "deploy title" }
102+ want := & GroupWiki {
103+ Content : "content here" ,
104+ Format : WikiFormatRDoc ,
105+ Slug : "deploy" ,
106+ Title : "deploy title" ,
107+ }
72108 if ! reflect .DeepEqual (want , groupwiki ) {
73109 t .Errorf ("GroupWikis.CreateGroupWikiPage returned %+v, want %+v" , groupwiki , want )
74110 }
@@ -81,7 +117,12 @@ func TestEditGroupWikiPage(t *testing.T) {
81117 mux .HandleFunc ("/api/v4/groups/1/wikis/deploy" ,
82118 func (w http.ResponseWriter , r * http.Request ) {
83119 testMethod (t , r , http .MethodPut )
84- fmt .Fprint (w , `{"content":"content here","format":"asciidoc","slug":"deploy","title":"deploy title"}` )
120+ fmt .Fprint (w , `{
121+ "content": "content here",
122+ "format": "asciidoc",
123+ "slug": "deploy",
124+ "title": "deploy title"
125+ }` )
85126 })
86127
87128 groupwiki , _ , err := client .GroupWikis .EditGroupWikiPage (1 , "deploy" , & EditGroupWikiPageOptions {
@@ -93,7 +134,12 @@ func TestEditGroupWikiPage(t *testing.T) {
93134 t .Errorf ("GroupWikis.EditGroupWikiPage returned error: %v" , err )
94135 }
95136
96- want := & GroupWiki {Content : "content here" , Format : WikiFormatASCIIDoc , Slug : "deploy" , Title : "deploy title" }
137+ want := & GroupWiki {
138+ Content : "content here" ,
139+ Format : WikiFormatASCIIDoc ,
140+ Slug : "deploy" ,
141+ Title : "deploy title" ,
142+ }
97143 if ! reflect .DeepEqual (want , groupwiki ) {
98144 t .Errorf ("GroupWikis.EditGroupWikiPage returned %+v, want %+v" , groupwiki , want )
99145 }
0 commit comments