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
As a logged in user, when I remove an identity from the front end, then data should be updated.
Bug :
Create a user with n identities ('Gay', 'Black', 'Male', 'Queer)
Using the PUT /users/:id route try to update the identities by removing one of them from the list. (i.e. send only 'Gay', 'Black', 'Male' in the identities_attributes)
Expected result
User should have only Gay, Black, Male in the identities list
Actual Result
User has : Gay, Black, Male, Queer, Gay, Black, Male in their identities list.
As a logged in user, when I remove an identity from the front end, then data should be updated.
Bug :
PUT /users/:id
route try to update the identities by removing one of them from the list. (i.e. send only 'Gay', 'Black', 'Male' in theidentities_attributes
)Expected result
User should have only
Gay, Black, Male
in the identities listActual Result
User has :
Gay, Black, Male, Queer, Gay, Black, Male
in their identities list.Notes
This is because the controller uses rails' relationship params to update identities which probably does not know how to deal with removing relationship data and just creates new relationship rows in the join table https://github.com/outintech/nbjc-app/blob/main/app/controllers/api/v1/users_controller.rb#L64
The text was updated successfully, but these errors were encountered: