|
|
|
@ -191,7 +191,8 @@ func TestRepositoriesService_Get(t *testing.T) { |
|
|
|
|
|
|
|
mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) { |
|
|
|
testMethod(t, r, "GET") |
|
|
|
fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"}}`) |
|
|
|
testHeader(t, r, "Accept", mediaTypeLicensesPreview) |
|
|
|
fmt.Fprint(w, `{"id":1,"name":"n","description":"d","owner":{"login":"l"},"license":{"key":"mit"}}`) |
|
|
|
}) |
|
|
|
|
|
|
|
repo, _, err := client.Repositories.Get("o", "r") |
|
|
|
@ -199,7 +200,7 @@ func TestRepositoriesService_Get(t *testing.T) { |
|
|
|
t.Errorf("Repositories.Get returned error: %v", err) |
|
|
|
} |
|
|
|
|
|
|
|
want := &Repository{ID: Int(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}} |
|
|
|
want := &Repository{ID: Int(1), Name: String("n"), Description: String("d"), Owner: &User{Login: String("l")}, License: &License{Key: String("mit")}} |
|
|
|
if !reflect.DeepEqual(repo, want) { |
|
|
|
t.Errorf("Repositories.Get returned %+v, want %+v", repo, want) |
|
|
|
} |
|
|
|
|