File tree 1 file changed +17
-0
lines changed
src/Felicity.IntegrationTests
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ module A =
30
30
31
31
let toMany = define.Relationship.ToMany( resDef) .Get( fun _ -> [])
32
32
33
+ let post = define.Operation.Post( fun () -> A)
34
+
33
35
let get = define.Operation.GetResource()
34
36
35
37
let customOp =
@@ -208,4 +210,19 @@ let tests =
208
210
Expect.isTrue ( json |> hasNoPath " errors[2]" ) " "
209
211
}
210
212
213
+ testJob " Has Location header in POST response even if resource link is skipped" {
214
+ let client = getClient ()
215
+
216
+ let! response =
217
+ Request.createWithClient client Post ( Uri( " http://example.com/as?skipAllLinks" ))
218
+ |> Request.jsonApiHeaders
219
+ |> Request.bodySerialized {| data = {| `` type `` = " a" |} |}
220
+ |> getResponse
221
+
222
+ response |> testSuccessStatusCode
223
+ let! json = response |> Response.readBodyAsString
224
+ Expect.isFalse ( json |> hasPath " data.links" ) " "
225
+ Expect.isTrue ( response.headers.TryFind Location = Some " http://example.com/as/1" ) " "
226
+ }
227
+
211
228
]
You can’t perform that action at this time.
0 commit comments