mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-23 10:30:41 +00:00
Create instance for test
This commit is contained in:
parent
b7cc2369a7
commit
43656d8e46
1 changed files with 17 additions and 0 deletions
|
@ -390,6 +390,7 @@ mod tests {
|
|||
posts::{NewPost, Post},
|
||||
safe_string::SafeString,
|
||||
users::{NewUser, User, AUTH_COOKIE},
|
||||
Connection as Conn, CONFIG,
|
||||
};
|
||||
use rocket::{
|
||||
http::{Cookie, Cookies, SameSite},
|
||||
|
@ -398,6 +399,22 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn edit_link_within_post_card() {
|
||||
let conn = Conn::establish(CONFIG.database_url.as_str()).unwrap();
|
||||
Instance::insert(
|
||||
&conn,
|
||||
NewInstance {
|
||||
public_domain: "example.org".to_string(),
|
||||
name: "Plume".to_string(),
|
||||
local: true,
|
||||
long_description: SafeString::new(""),
|
||||
short_description: SafeString::new(""),
|
||||
default_license: "CC-BY-SA".to_string(),
|
||||
open_registrations: true,
|
||||
short_description_html: String::new(),
|
||||
long_description_html: String::new(),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
let rocket = init_rocket();
|
||||
let client = Client::new(rocket).expect("valid rocket instance");
|
||||
let dbpool = client.rocket().state::<DbPool>().unwrap();
|
||||
|
|
Loading…
Reference in a new issue