0

When testing my controllers (that use jsonapi-resources), on update I have been bumping into this error.

{\"errors\":[{\"title\":\"Key is not included in URL\",\"detail\":\"The URL does not support the key 946591862\",\"id\":null,\"href\":null,\"code\":\"110\",\"source\":null,\"links\":null,\"status\":\"400\",\"meta\":null}]} 

An example of the code the makes the request

process :update, method: :post, params: {
  id: model_id,
  data: update_attributes
}

I'm just writing basic ActionController::TestCase tests. the update_attributes method follows the following format:

{
  id: model_id,
  attributes: attributes,
  type: model_type
}

1 Answers1

0

Ah. The issue I have is that I was using different ids inside and outside the data hash.