@@ -79,7 +79,7 @@ impl ::util::MockTokenUser {
79
79
80
80
#[ test]
81
81
fn index ( ) {
82
- let ( app, anon) = TestApp :: empty ( ) ;
82
+ let ( app, anon) = TestApp :: init ( ) . empty ( ) ;
83
83
let json = anon. search ( "" ) ;
84
84
assert_eq ! ( json. crates. len( ) , 0 ) ;
85
85
assert_eq ! ( json. meta. total, 0 ) ;
@@ -98,7 +98,7 @@ fn index() {
98
98
99
99
#[ test]
100
100
fn index_queries ( ) {
101
- let ( app, anon, user) = TestApp :: with_user ( ) ;
101
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
102
102
let user = user. as_model ( ) ;
103
103
104
104
let ( krate, krate2) = app. db ( |conn| {
@@ -179,7 +179,7 @@ fn index_queries() {
179
179
180
180
#[ test]
181
181
fn search_includes_crates_where_name_is_stopword ( ) {
182
- let ( app, anon, user) = TestApp :: with_user ( ) ;
182
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
183
183
let user = user. as_model ( ) ;
184
184
app. db ( |conn| {
185
185
CrateBuilder :: new ( "which" , user. id ) . expect_build ( conn) ;
@@ -194,7 +194,7 @@ fn search_includes_crates_where_name_is_stopword() {
194
194
195
195
#[ test]
196
196
fn exact_match_first_on_queries ( ) {
197
- let ( app, anon, user) = TestApp :: with_user ( ) ;
197
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
198
198
let user = user. as_model ( ) ;
199
199
200
200
app. db ( |conn| {
@@ -236,7 +236,7 @@ fn exact_match_first_on_queries() {
236
236
237
237
#[ test]
238
238
fn index_sorting ( ) {
239
- let ( app, anon, user) = TestApp :: with_user ( ) ;
239
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
240
240
let user = user. as_model ( ) ;
241
241
242
242
app. db ( |conn| {
@@ -318,7 +318,7 @@ fn index_sorting() {
318
318
319
319
#[ test]
320
320
fn exact_match_on_queries_with_sort ( ) {
321
- let ( app, anon, user) = TestApp :: with_user ( ) ;
321
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
322
322
let user = user. as_model ( ) ;
323
323
324
324
app. db ( |conn| {
@@ -416,7 +416,7 @@ fn exact_match_on_queries_with_sort() {
416
416
417
417
#[ test]
418
418
fn show ( ) {
419
- let ( app, anon, user) = TestApp :: with_user ( ) ;
419
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
420
420
let user = user. as_model ( ) ;
421
421
422
422
let krate = app. db ( |conn| {
@@ -463,7 +463,7 @@ fn show() {
463
463
464
464
#[ test]
465
465
fn yanked_versions_are_not_considered_for_max_version ( ) {
466
- let ( app, anon, user) = TestApp :: with_user ( ) ;
466
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
467
467
let user = user. as_model ( ) ;
468
468
469
469
app. db ( |conn| {
@@ -481,7 +481,7 @@ fn yanked_versions_are_not_considered_for_max_version() {
481
481
482
482
#[ test]
483
483
fn versions ( ) {
484
- let ( app, anon) = TestApp :: empty ( ) ;
484
+ let ( app, anon) = TestApp :: init ( ) . empty ( ) ;
485
485
app. db ( |conn| {
486
486
let u = new_user ( "foo" ) . create_or_update ( conn) . unwrap ( ) ;
487
487
CrateBuilder :: new ( "foo_versions" , u. id )
@@ -854,7 +854,7 @@ fn valid_feature_names() {
854
854
855
855
#[ test]
856
856
fn new_krate_too_big ( ) {
857
- let ( _, _, user) = TestApp :: with_user ( ) ;
857
+ let ( _, _, user) = TestApp :: init ( ) . with_user ( ) ;
858
858
let files = [ ( "foo_big-1.0.0/big" , & [ b'a' ; 2000 ] as & [ _ ] ) ] ;
859
859
let builder = PublishBuilder :: new ( "foo_big" ) . files ( & files) ;
860
860
@@ -1103,13 +1103,13 @@ fn new_krate_with_readme() {
1103
1103
1104
1104
#[ test]
1105
1105
fn summary_doesnt_die ( ) {
1106
- let ( _, anon) = TestApp :: empty ( ) ;
1106
+ let ( _, anon) = TestApp :: init ( ) . empty ( ) ;
1107
1107
anon. get :: < SummaryResponse > ( "/api/v1/summary" ) . good ( ) ;
1108
1108
}
1109
1109
1110
1110
#[ test]
1111
1111
fn summary_new_crates ( ) {
1112
- let ( app, anon, user) = TestApp :: with_user ( ) ;
1112
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
1113
1113
let user = user. as_model ( ) ;
1114
1114
app. db ( |conn| {
1115
1115
let krate = CrateBuilder :: new ( "some_downloads" , user. id )
@@ -1176,7 +1176,7 @@ fn summary_new_crates() {
1176
1176
#[ test]
1177
1177
fn download ( ) {
1178
1178
use chrono:: { Duration , Utc } ;
1179
- let ( app, anon, user) = TestApp :: with_user ( ) ;
1179
+ let ( app, anon, user) = TestApp :: with_proxy ( ) . with_user ( ) ;
1180
1180
let user = user. as_model ( ) ;
1181
1181
1182
1182
app. db ( |conn| {
@@ -1260,7 +1260,7 @@ fn dependencies() {
1260
1260
1261
1261
#[ test]
1262
1262
fn diesel_not_found_results_in_404 ( ) {
1263
- let ( _, _, user) = TestApp :: with_user ( ) ;
1263
+ let ( _, _, user) = TestApp :: init ( ) . with_user ( ) ;
1264
1264
1265
1265
user. get ( "/api/v1/crates/foo_following/following" )
1266
1266
. assert_not_found ( ) ;
@@ -1269,7 +1269,7 @@ fn diesel_not_found_results_in_404() {
1269
1269
#[ test]
1270
1270
fn following ( ) {
1271
1271
// TODO: Test anon requests as well?
1272
- let ( app, _, user) = TestApp :: with_user ( ) ;
1272
+ let ( app, _, user) = TestApp :: init ( ) . with_user ( ) ;
1273
1273
1274
1274
app. db ( |conn| {
1275
1275
CrateBuilder :: new ( "foo_following" , user. as_model ( ) . id ) . expect_build ( & conn) ;
@@ -1399,7 +1399,7 @@ fn yank() {
1399
1399
1400
1400
#[ test]
1401
1401
fn yank_not_owner ( ) {
1402
- let ( app, _, _, token) = TestApp :: with_token ( ) ;
1402
+ let ( app, _, _, token) = TestApp :: init ( ) . with_token ( ) ;
1403
1403
app. db ( |conn| {
1404
1404
let another_user = new_user ( "bar" ) . create_or_update ( conn) . unwrap ( ) ;
1405
1405
CrateBuilder :: new ( "foo_not" , another_user. id ) . expect_build ( conn) ;
@@ -2019,7 +2019,7 @@ fn author_license_and_description_required() {
2019
2019
*/
2020
2020
#[ test]
2021
2021
fn test_recent_download_count ( ) {
2022
- let ( app, anon, user) = TestApp :: with_user ( ) ;
2022
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
2023
2023
let user = user. as_model ( ) ;
2024
2024
2025
2025
app. db ( |conn| {
@@ -2057,7 +2057,7 @@ fn test_recent_download_count() {
2057
2057
*/
2058
2058
#[ test]
2059
2059
fn test_zero_downloads ( ) {
2060
- let ( app, anon, user) = TestApp :: with_user ( ) ;
2060
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
2061
2061
let user = user. as_model ( ) ;
2062
2062
2063
2063
app. db ( |conn| {
@@ -2082,7 +2082,7 @@ fn test_zero_downloads() {
2082
2082
*/
2083
2083
#[ test]
2084
2084
fn test_default_sort_recent ( ) {
2085
- let ( app, anon, user) = TestApp :: with_user ( ) ;
2085
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
2086
2086
let user = user. as_model ( ) ;
2087
2087
2088
2088
let ( green_crate, potato_crate) = app. db ( |conn| {
@@ -2145,7 +2145,7 @@ fn test_default_sort_recent() {
2145
2145
2146
2146
#[ test]
2147
2147
fn block_bad_documentation_url ( ) {
2148
- let ( app, anon, user) = TestApp :: with_user ( ) ;
2148
+ let ( app, anon, user) = TestApp :: init ( ) . with_user ( ) ;
2149
2149
let user = user. as_model ( ) ;
2150
2150
2151
2151
app. db ( |conn| {
@@ -2163,7 +2163,7 @@ fn block_bad_documentation_url() {
2163
2163
// which call the `PUT /crates/:crate_id/owners` route
2164
2164
#[ test]
2165
2165
fn test_cargo_invite_owners ( ) {
2166
- let ( app, _, owner) = TestApp :: with_user ( ) ;
2166
+ let ( app, _, owner) = TestApp :: init ( ) . with_user ( ) ;
2167
2167
2168
2168
let new_user = app. db_new_user ( "cilantro" ) ;
2169
2169
app. db ( |conn| {
0 commit comments