pub struct TestApp { /* private fields */ }Implementations§
Source§impl TestApp
impl TestApp
pub fn db(&self) -> &Db
pub fn clock(&self) -> &TestClock
Sourcepub async fn drain(&self) -> usize
pub async fn drain(&self) -> usize
Fails the test when a job fails or panics; drain_failing is for failures a test expects.
Sourcepub async fn advance(&self, by: Duration) -> usize
pub async fn advance(&self, by: Duration) -> usize
Stops at each moment a schedule, retry or delayed job comes due on the way, draining there.
pub async fn query(&self, sql: &str, params: &[SqlValue]) -> Vec<Vec<SqlValue>>
Sourcepub fn origin(&self) -> &str
pub fn origin(&self) -> &str
http:// and the address the app is served at, as a browser’s Origin names it.
pub fn get(&self, path: &str) -> TestRequest
pub fn post(&self, path: &str) -> TestRequest
pub fn request(&self, route: &RoutePath) -> TestRequest
pub fn as_<A: Area>(&self, principal: &TestPrincipal<A>) -> TestCaller<'_>
Sourcepub fn principal_of<A: Area>(
&self,
session: &TestSession,
) -> Option<TestPrincipal<A>>
pub fn principal_of<A: Area>( &self, session: &TestSession, ) -> Option<TestPrincipal<A>>
Whom a session the app issued signs in to area A, if anyone.
pub fn fixture<A: Create>(&self) -> AggregateFixture<'_, A>
Auto Trait Implementations§
impl !Freeze for TestApp
impl !RefUnwindSafe for TestApp
impl !UnwindSafe for TestApp
impl Send for TestApp
impl Sync for TestApp
impl Unpin for TestApp
impl UnsafeUnpin for TestApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more