@@ -10,6 +10,8 @@ import (
10
10
11
11
"io"
12
12
13
+ "gotest.tools/golden"
14
+
13
15
. "github.com/onsi/ginkgo"
14
16
. "github.com/onsi/gomega"
15
17
"github.com/onsi/gomega/gbytes"
@@ -1081,23 +1083,18 @@ var _ = Describe("Orb integration tests", func() {
1081
1083
1082
1084
It ("makes a namespace query and requests all orbs on that namespace" , func () {
1083
1085
By ("setting up a mock server" )
1084
-
1085
1086
// These requests and responses are generated from production data,
1086
1087
// but using a 5-per-page limit instead of the 20 requested.
1087
- tmpBytes , err := ioutil .ReadFile (filepath .Join ("testdata/gql_orb_list_with_namespace" , "first_request.json" ))
1088
- Expect (err ).ShouldNot (HaveOccurred ())
1088
+ tmpBytes := golden .Get (GinkgoT (), filepath .FromSlash ("gql_orb_list_with_namespace/first_request.json" ))
1089
1089
firstGqlRequest := string (tmpBytes )
1090
1090
1091
- tmpBytes , err = ioutil .ReadFile (filepath .Join ("testdata/gql_orb_list_with_namespace" , "second_request.json" ))
1092
- Expect (err ).ShouldNot (HaveOccurred ())
1091
+ tmpBytes = golden .Get (GinkgoT (), filepath .FromSlash ("gql_orb_list_with_namespace/second_request.json" ))
1093
1092
secondGqlRequest := string (tmpBytes )
1094
1093
1095
- tmpBytes , err = ioutil .ReadFile (filepath .Join ("testdata/gql_orb_list_with_namespace" , "first_response.json" ))
1096
- Expect (err ).ShouldNot (HaveOccurred ())
1094
+ tmpBytes = golden .Get (GinkgoT (), filepath .FromSlash ("gql_orb_list_with_namespace/first_response.json" ))
1097
1095
firstGqlResponse := string (tmpBytes )
1098
1096
1099
- tmpBytes , err = ioutil .ReadFile (filepath .Join ("testdata/gql_orb_list_with_namespace" , "second_response.json" ))
1100
- Expect (err ).ShouldNot (HaveOccurred ())
1097
+ tmpBytes = golden .Get (GinkgoT (), filepath .FromSlash ("gql_orb_list_with_namespace/second_response.json" ))
1101
1098
secondGqlResponse := string (tmpBytes )
1102
1099
1103
1100
// Use Gomega's default matcher instead of our custom appendPostHandler
0 commit comments