()
| 1365 | |
| 1366 | #[test] |
| 1367 | fn simple_case() { |
| 1368 | let topic1 = topic("Climate change"); |
| 1369 | let topic2 = topic("Climate"); |
| 1370 | let topic3 = topic("Weather"); |
| 1371 | |
| 1372 | let change = Change::UpdateTopicParentTopics(UpdateTopicParentTopics { |
| 1373 | actor_id: "2".to_owned(), |
| 1374 | added_parent_topics: TopicInfoList::from(&topic2), |
| 1375 | date: chrono::Utc::now(), |
| 1376 | id: Change::new_id(), |
| 1377 | parent_topic_ids: BTreeSet::from([topic3.topic_id().to_owned()]), |
| 1378 | removed_parent_topics: TopicInfoList::new(), |
| 1379 | updated_topic: TopicInfo::from(&topic1), |
| 1380 | }); |
| 1381 | |
| 1382 | assert_eq!( |
| 1383 | change.markdown(Locale::EN, "Gnusto", None), |
| 1384 | format!( |
| 1385 | "Gnusto placed [Climate change]({}) under [Climate]({})", |
| 1386 | topic1.relative_url(), |
| 1387 | topic2.relative_url() |
| 1388 | ), |
| 1389 | ); |
| 1390 | } |
| 1391 | |
| 1392 | #[test] |
| 1393 | fn paths() { |
nothing calls this directly
no test coverage detected