diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-09 18:28:46 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-09 18:28:48 -0800 |
commit | 8317f6cb38622e36dad6bd4ad34e3cf6dac3bdad (patch) | |
tree | df4131a22b1fbd5210e4e5d26a832d12c1dda3a0 /rust/tests/helpers.rs | |
parent | c8a8cb4ec532cbf1a6821fba4b2084b4f0e7b4c0 (diff) | |
download | fatcat-8317f6cb38622e36dad6bd4ad34e3cf6dac3bdad.tar.gz fatcat-8317f6cb38622e36dad6bd4ad34e3cf6dac3bdad.zip |
fix a bunch of test issues
I previously was only running a single test locally; oops! CI caught
them.
Diffstat (limited to 'rust/tests/helpers.rs')
-rw-r--r-- | rust/tests/helpers.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rust/tests/helpers.rs b/rust/tests/helpers.rs index 677a8855..01891eaf 100644 --- a/rust/tests/helpers.rs +++ b/rust/tests/helpers.rs @@ -9,6 +9,10 @@ use iron::{status, Chain, Headers, Iron, Listening}; use iron_test::response; use std::str::FromStr; + +pub static TEST_ADMIN_EDITOR_ID: &str = "aaaaaaaaaaaabkvkaaaaaaaaae"; +//static TEST_ADMIN_EDITOR_ID: FatCatId = FatCatId::from_str("aaaaaaaaaaaabkvkaaaaaaaaae").unwrap(); + // A current problem with this method is that if the test fails (eg, panics, assert fails), the // server never gets closed, and the server thread hangs forever. // One workaround might be to invert the function, take a closure, capture the panic/failure, and @@ -18,7 +22,7 @@ pub fn setup_client() -> (Client, Context, Listening) { let server = server::create_test_server().unwrap(); // setup auth as admin user - let admin_id = FatCatId::from_str("aaaaaaaaaaaabkvkaaaaaaaaae").unwrap(); + let admin_id = FatCatId::from_str(TEST_ADMIN_EDITOR_ID).unwrap(); let token = server .auth_confectionary .create_token(admin_id, None) @@ -55,7 +59,7 @@ pub fn setup_http() -> ( let conn = server.db_pool.get().expect("db_pool error"); // setup auth as admin user - let admin_id = FatCatId::from_str("aaaaaaaaaaaabkvkaaaaaaaaae").unwrap(); + let admin_id = FatCatId::from_str(TEST_ADMIN_EDITOR_ID).unwrap(); let token = server .auth_confectionary .create_token(admin_id, None) |