@@ -33,7 +33,7 @@ spec actualPgVersion = do
33
33
resStatus = simpleStatus r
34
34
35
35
liftIO $ do
36
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; charset=utf-8" )
36
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; charset=utf-8" )
37
37
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
38
38
totalCost `shouldBe`
39
39
if actualPgVersion > pgVersion120
@@ -49,7 +49,7 @@ spec actualPgVersion = do
49
49
resStatus = simpleStatus r
50
50
51
51
liftIO $ do
52
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; charset=utf-8" )
52
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; charset=utf-8" )
53
53
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
54
54
totalCost `shouldBe`
55
55
if actualPgVersion > pgVersion120
@@ -65,7 +65,7 @@ spec actualPgVersion = do
65
65
resHeaders = simpleHeaders r
66
66
67
67
liftIO $ do
68
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; options=buffers; charset=utf-8" )
68
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; options=buffers; charset=utf-8" )
69
69
resBody `shouldSatisfy` (\ t -> T. isInfixOf " Shared Hit Blocks" (decodeUtf8 $ BS. toStrict t))
70
70
else do
71
71
-- analyze is required for buffers on pg < 13
@@ -75,7 +75,7 @@ spec actualPgVersion = do
75
75
resHeaders = simpleHeaders r
76
76
77
77
liftIO $ do
78
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; options=analyze|buffers; charset=utf-8" )
78
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; options=analyze|buffers; charset=utf-8" )
79
79
blocks `shouldBe` Just [aesonQQ | 1.0 |]
80
80
81
81
when (actualPgVersion >= pgVersion120) $
@@ -86,7 +86,7 @@ spec actualPgVersion = do
86
86
resHeaders = simpleHeaders r
87
87
88
88
liftIO $ do
89
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; options=settings; charset=utf-8" )
89
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; options=settings; charset=utf-8" )
90
90
searchPath `shouldBe`
91
91
Just [aesonQQ |
92
92
{
@@ -102,7 +102,7 @@ spec actualPgVersion = do
102
102
resHeaders = simpleHeaders r
103
103
104
104
liftIO $ do
105
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; options=analyze|wal; charset=utf-8" )
105
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; options=analyze|wal; charset=utf-8" )
106
106
walRecords `shouldBe` Just [aesonQQ |0|]
107
107
108
108
it " outputs columns info when using the verbose option" $ do
@@ -112,7 +112,7 @@ spec actualPgVersion = do
112
112
resHeaders = simpleHeaders r
113
113
114
114
liftIO $ do
115
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; options=verbose; charset=utf-8" )
115
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; options=verbose; charset=utf-8" )
116
116
cols `shouldBe` Just [aesonQQ | ["projects.id", "projects.name", "projects.client_id"] |]
117
117
118
118
it " outputs the plan for application/json " $ do
@@ -151,7 +151,7 @@ spec actualPgVersion = do
151
151
resStatus = simpleStatus r
152
152
153
153
liftIO $ do
154
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; charset=utf-8" )
154
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; charset=utf-8" )
155
155
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
156
156
totalCost `shouldBe` 3.27
157
157
@@ -164,7 +164,7 @@ spec actualPgVersion = do
164
164
resStatus = simpleStatus r
165
165
166
166
liftIO $ do
167
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; charset=utf-8" )
167
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; charset=utf-8" )
168
168
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
169
169
totalCost `shouldBe` 12.45
170
170
@@ -177,7 +177,7 @@ spec actualPgVersion = do
177
177
resStatus = simpleStatus r
178
178
179
179
liftIO $ do
180
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; charset=utf-8" )
180
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; charset=utf-8" )
181
181
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
182
182
totalCost `shouldBe` 15.68
183
183
@@ -191,7 +191,7 @@ spec actualPgVersion = do
191
191
resStatus = simpleStatus r
192
192
193
193
liftIO $ do
194
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; charset=utf-8" )
194
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; charset=utf-8" )
195
195
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
196
196
totalCost `shouldBe` 1.29
197
197
@@ -216,7 +216,7 @@ spec actualPgVersion = do
216
216
resStatus = simpleStatus r
217
217
218
218
liftIO $ do
219
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; charset=utf-8" )
219
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+json; for= \" application/json \" ; charset=utf-8" )
220
220
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
221
221
totalCost `shouldBe` 68.56
222
222
@@ -241,7 +241,7 @@ spec actualPgVersion = do
241
241
resStatus = simpleStatus r
242
242
243
243
liftIO $ do
244
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+text; charset=utf-8" )
244
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+text; for= \" application/json \" ; charset=utf-8" )
245
245
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
246
246
resBody `shouldSatisfy` (\ t -> LBS. take 9 t == " Aggregate" )
247
247
@@ -254,7 +254,7 @@ spec actualPgVersion = do
254
254
resStatus = simpleStatus r
255
255
256
256
liftIO $ do
257
- resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan; charset=utf-8" )
257
+ resHeaders `shouldSatisfy` elem (" Content-Type" , " application/vnd.pgrst.plan+text; for= \" application/json \" ; charset=utf-8" )
258
258
resStatus `shouldBe` Status { statusCode = 200 , statusMessage= " OK" }
259
259
resBody `shouldSatisfy` (\ t -> LBS. take 9 t == " Aggregate" )
260
260
0 commit comments