| 317 | |
| 318 | #[test] |
| 319 | fn no_cycles() { |
| 320 | let f = Fixtures::copy("simple"); |
| 321 | let repo_id = RepoId::wiki(); |
| 322 | let parent = f.topic(repo_id, ROOT_TOPIC_ID); |
| 323 | let child = f.topic(repo_id, "00001"); |
| 324 | assert!(parent.has_child(child.topic_id())); |
| 325 | |
| 326 | let result = UpdateTopicParentTopics { |
| 327 | actor: actor(), |
| 328 | repo_id, |
| 329 | topic_id: parent.topic_id(), |
| 330 | parent_topic_ids: &[child.topic_id().to_owned()], |
| 331 | } |
| 332 | .call(f.mutation(), &redis::Noop); |
| 333 | |
| 334 | assert!(matches!(result, Err(Error::Repo(_)))); |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | #[cfg(test)] |