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 !
The text was updated successfully, but these errors were encountered:
Startouf
changed the title
assert_payload tests can pass on empty attributes payload and nil json_item
assert_payload tests can become false positives on empty attributes payload and nil json_item
Jul 26, 2017
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 :
The text was updated successfully, but these errors were encountered: