(Almost) full test coverage
This commit is contained in:
parent
0639c5ca12
commit
544e380835
8 changed files with 417 additions and 100 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue