Skip to content

Commit

Permalink
Avoid initializing the playback proxy for a few remaining tests
Browse files Browse the repository at this point in the history
This list was obtained by temporarily causing playback to panic if
there was no `http-data` file when the proxy is started.

The only remaining test that starts a proxy server which goes unused is
`krate::yank_not_owner`, however this test does need an index.  If more
tests fall into this category over time we can switch to a full builder
API for orchestrating a `TestApp` but that doesn't seem necessary yet.
  • Loading branch information
jtgeibel committed Mar 21, 2019
1 parent df7122f commit 9517c3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/tests/krate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ fn new_krate_with_readme() {

#[test]
fn new_krate_without_any_email_fails() {
let (app, _, _, token) = TestApp::with_proxy().with_token();
let (app, _, _, token) = TestApp::init().with_token();

app.db(|conn| {
delete(emails::table).execute(conn).unwrap();
Expand All @@ -1087,7 +1087,7 @@ fn new_krate_without_any_email_fails() {

#[test]
fn new_krate_with_unverified_email_fails() {
let (app, _, _, token) = TestApp::with_proxy().with_token();
let (app, _, _, token) = TestApp::init().with_token();

app.db(|conn| {
update(emails::table)
Expand Down Expand Up @@ -1201,7 +1201,7 @@ fn summary_new_crates() {
#[test]
fn download() {
use chrono::{Duration, Utc};
let (app, anon, user) = TestApp::with_proxy().with_user();
let (app, anon, user) = TestApp::init().with_user();
let user = user.as_model();

app.db(|conn| {
Expand Down Expand Up @@ -1253,7 +1253,7 @@ fn download() {

#[test]
fn download_nonexistent_version_of_existing_crate_404s() {
let (app, anon, user) = TestApp::with_proxy().with_user();
let (app, anon, user) = TestApp::init().with_user();
let user = user.as_model();

app.db(|conn| {
Expand Down
2 changes: 1 addition & 1 deletion src/tests/read_only_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn cannot_hit_endpoint_which_writes_db_in_read_only_mode() {

#[test]
fn can_download_crate_in_read_only_mode() {
let (app, anon, user) = TestApp::with_proxy().with_user();
let (app, anon, user) = TestApp::init().with_user();

app.db(|conn| {
CrateBuilder::new("foo_download_read_only", user.as_model().id)
Expand Down

0 comments on commit 9517c3e

Please sign in to comment.