You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have special payload/serialized result in my app made almost entirely of relationships and no attributes (a conversation = list of messages + references to senders, etc.)
Therefore, my test payload declaration was empty.
In my test, the payload assertion was passing although the return from the controller was nil / the test should have failed
In a nutshell :
# spec/payloads/messaging/conversation.rb
JsonapiSpecHelpers::Payload.register(:'messaging/conversation') do
# empty, only relationships
end
# spec/requests/messaging/conversations_controller.rb
...
json_item = {"id"=>nil, "jsonapi_type"=>nil}
assert_payload(:'messaging/conversation', conversation, json_item)
# Would pass !