@@ -76,20 +76,20 @@ func TestRepositoriesService_UpdatePages(t *testing.T) {
7676
7777 input := & PagesUpdate {
7878 CNAME : String ("www.my-domain.com" ),
79- Source : String ("gh-pages" ),
79+ Source : & PagesSource { Branch : String ("gh-pages" )} ,
8080 }
8181
8282 mux .HandleFunc ("/repos/o/r/pages" , func (w http.ResponseWriter , r * http.Request ) {
8383 v := new (PagesUpdate )
8484 json .NewDecoder (r .Body ).Decode (v )
8585
8686 testMethod (t , r , "PUT" )
87- want := & PagesUpdate {CNAME : String ("www.my-domain.com" ), Source : String ("gh-pages" )}
87+ want := & PagesUpdate {CNAME : String ("www.my-domain.com" ), Source : & PagesSource { Branch : String ("gh-pages" )} }
8888 if ! cmp .Equal (v , want ) {
8989 t .Errorf ("Request body = %+v, want %+v" , v , want )
9090 }
9191
92- fmt .Fprint (w , `{"cname":"www.my-domain.com","source":" gh-pages"}` )
92+ fmt .Fprint (w , `{"cname":"www.my-domain.com","source":{"branch":" gh-pages"} }` )
9393 })
9494
9595 ctx := context .Background ()
@@ -114,7 +114,7 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) {
114114 defer teardown ()
115115
116116 input := & PagesUpdate {
117- Source : String ("gh-pages" ),
117+ Source : & PagesSource { Branch : String ("gh-pages" )} ,
118118 }
119119
120120 mux .HandleFunc ("/repos/o/r/pages" , func (w http.ResponseWriter , r * http.Request ) {
@@ -123,12 +123,12 @@ func TestRepositoriesService_UpdatePages_NullCNAME(t *testing.T) {
123123 t .Fatalf ("unable to read body: %v" , err )
124124 }
125125
126- want := []byte (`{"cname":null,"source":" gh-pages"}` + "\n " )
126+ want := []byte (`{"cname":null,"source":{"branch":" gh-pages"} }` + "\n " )
127127 if ! bytes .Equal (got , want ) {
128128 t .Errorf ("Request body = %+v, want %+v" , got , want )
129129 }
130130
131- fmt .Fprint (w , `{"cname":null,"source":" gh-pages"}` )
131+ fmt .Fprint (w , `{"cname":null,"source":{"branch":" gh-pages"} }` )
132132 })
133133
134134 ctx := context .Background ()
@@ -393,12 +393,12 @@ func TestPagesUpdate_Marshal(t *testing.T) {
393393
394394 u := & PagesUpdate {
395395 CNAME : String ("cname" ),
396- Source : String ("src" ),
396+ Source : & PagesSource { Path : String ("src" )} ,
397397 }
398398
399399 want := `{
400400 "cname": "cname",
401- "source": " src"
401+ "source": { "path": " src" }
402402 }`
403403
404404 testJSONMarshal (t , u , want )
0 commit comments