-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP #1105 fix bug with inclusion and linkage of has_one polymorphic #1108
base: master
Are you sure you want to change the base?
WIP #1105 fix bug with inclusion and linkage of has_one polymorphic #1108
Conversation
three failures left:
|
@lgebhardt, I end up with an understanding that when we include relationship and it is not linked response does not have data in relationship object BTW this behaviour is not tested at all, so all tests are green, which is completely wrong |
@senid231 Thanks for the detailed error report. With the refactor I was worried about behaviors that were not explicitly tested, like this case. |
@lgebhardt many cases aren't tested yet, and it's hard to add tests into the project, and hard to understand. |
BTW, what should I do with this PR? should I remove @lgebhardt, I'm not familiar with the latest refactoring that you made, so finish it now. I can continue when I will have free time, or maybe you want to fix the issue with response serialization? |
@senid231 I agree that the tests could be refactored, but it will be a large undertaking (and I don't have a lot of time for it). Probably the best way would be to add new tests as unit and integration tests and leave the existing tests in place. Eventually we can remove them after we ensure all the relevant functionality is tested. |
You can leave the I'm not sure what you mean by "finish it now"? Are you referring to #1045? It is finished, but may still have bugs as you have found. I plan to get a related resource pagination support added before we do an alpha release where hopefully the bugs can be shaken out. |
@lgebhardt what do you think about testing with |
By "finish it now" I meant that I can't finish work on this PR and fix all bugs that I found. There are many changes in project, that I don't understand, yet |
I don't have an opinion on RSpec. At this point it would need to be drastically better to justify the expense of switching. To me the problem with the test suite in JR isn't the testing framework, but rather that things are tested at too high of a level (controller/integration instead of unit). I tent agree with @tenderlove here: https://tenderlovemaking.com/2015/01/23/my-experience-with-minitest-and-rspec.html |
@senid231 I understand if you don't have time to fix all the bugs you find. If you can create an issue to describe them, even if it doesn't contain a fully reproducible bug report like you provided here, it will be appreciated. |
097c228
to
0dffe4c
Compare
@lgebhardt I have added tests that cover fixes that I made and bug with missing |
…orphic add tests for link/unlink polymorphic relationships with include them in response add tests for include not linked relationships
0dffe4c
to
5ab6685
Compare
@lgebhardt I rebased this PR |
If I understand this issue, I think that 0.10 fixes it? – I was having an issue where I had a model with a has_one relationship, and then specified has_one in my resource, and then included that record in my request and received a 500 error where it was using the belongs_to builder instead of the has_one builder.... Updated to 0.10 and no longer having any trouble. |
@gordonbisnor @lgebhardt but 0.9 still have an issue and 0.10 is not stable yet I can rebase this PR to 0.9 what do you think about it? |
WIP Fix #1105
assignment and inclusion of has_one polymorphic relationships works incorrectly
tested on bug report