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
The IO.inspect/1 outputs the following, showing that source_id is set to a valid hash, rather than the intended "invalid":
%{source_id: "775adc233d133ff96f25a64934fecc07e33055f1679bda74cd7c412c9c989b15",target_id: "622a55ea583fb59a5f9547171d821ad2a30f63d1911d598b21f270fa84d126f2",anchor_text: "A test anchor text"}
Proposed Solution
To address this, I propose passing the attrs to insert_belongs_to_assocs/2 to check if the owner_key is already present in attrs before calling insert_build_belongs_to_assoc/3. This change would skip association insertion when the owner_key is explicitly provided, allowing for more controlled test setups and preventing unintended data setup.
Here’s a suggested modification to lib/ex_machina/ecto.ex:
Description
I encountered an issue in my test setup where a parameter is unexpectedly set by insert_belongs_to_assocs/2, causing a test case to fail.
Current Behavior
Here's the test snippet:
The IO.inspect/1 outputs the following, showing that source_id is set to a valid hash, rather than the intended "invalid":
Proposed Solution
To address this, I propose passing the attrs to insert_belongs_to_assocs/2 to check if the owner_key is already present in attrs before calling insert_build_belongs_to_assoc/3. This change would skip association insertion when the owner_key is explicitly provided, allowing for more controlled test setups and preventing unintended data setup.
Here’s a suggested modification to lib/ex_machina/ecto.ex:
I am happy to submit a PR if this solution aligns with the project's goals.
Let me know if you need further modifications or additional details for the issue!
The text was updated successfully, but these errors were encountered: