Skip to content

Commit

Permalink
Create instance for test
Browse files Browse the repository at this point in the history
  • Loading branch information
KitaitiMakoto committed Dec 5, 2021
1 parent b7cc236 commit 43656d8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/routes/blogs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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();
Expand Down

0 comments on commit 43656d8

Please sign in to comment.