(Almost) full test coverage

This commit is contained in:
Julia Lange 2026-01-26 15:00:52 -08:00
parent 0639c5ca12
commit 544e380835
Signed by: Julia
SSH key fingerprint: SHA256:5DJcfxa5/fKCYn57dcabJa2vN2e6eT0pBerYi5SUbto
8 changed files with 417 additions and 100 deletions

View file

@ -56,21 +56,29 @@ mod tests {
use super::*;
use reqwest::Url;
use crate::{
Adapter,
AdapterBuilder,
db::{
Channel,
FeedId,
User
}
},
test_utils::{
FEED1, setup_adapter,
},
};
const FEED1: &str = "https://example.com/feed";
#[test]
fn parse() {
const CID: i64 = 1;
const FID: i64 = 1;
let ufc = UnparsedFeedChannel {
channel_id: CID,
feed_id: FID,
};
async fn setup_adapter() -> Adapter {
AdapterBuilder::new()
.database_url("sqlite::memory:")
.create().await.unwrap()
let fc = ufc.parse().unwrap();
assert_eq!(fc.channel_id.0, CID);
assert_eq!(fc.feed_id.0, FID);
}
// FeedChannel Tests