Commit f6a479b
committed
Bug Fix: Ensured
After marking the content types as `!IsNew` in the `StubTopicRepository` (45aa7be)`, the test which confirmed that `ResetPermittedContentTypes()` was called when saving a `ContentTypeDescriptor` with a `Relationships` collection marked `IsDirty()` started failing.
It turns out this was indicative of a genuine bug in the underlying application which was covered up by the fact that the content type descriptors hadn't been saved. That's because the code to determine if the relationships are dirty was occurring after the `Save()`—at which point the relationships are marked as clean. Since collections containing `IsNew` topics cannot be marked as clean, however, this worked in the previous test case. In the updated test case, which better represents real world conditions, this failed.
This is easily fixed by caching the value of `Relationships.IsDirty()` prior to marking the collection as clean. This resolves #81.ResetPermittedContentTypes() is correctly called1 parent b86b4dc commit f6a479b
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
| |||
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
408 | | - | |
| 409 | + | |
409 | 410 | | |
410 | 411 | | |
411 | 412 | | |
| |||
0 commit comments