Skip to content

Commit b1b7792

Browse files
committed
Fix the test setup to create the version we're trying to yank
This makes the error returned what we're really trying to test for
1 parent da22871 commit b1b7792

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tests/krate.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,13 +1430,15 @@ fn yank_by_a_non_owner_fails() {
14301430
let another_user = app.db_new_user("bar");
14311431
let another_user = another_user.as_model();
14321432
app.db(|conn| {
1433-
CrateBuilder::new("foo_not", another_user.id).expect_build(conn);
1433+
CrateBuilder::new("foo_not", another_user.id)
1434+
.version("1.0.0")
1435+
.expect_build(conn);
14341436
});
14351437

14361438
let json = token.yank("foo_not", "1.0.0").bad_with_status(200);
14371439
assert_eq!(
14381440
json.errors[0].detail,
1439-
"crate `foo_not` does not have a version `1.0.0`"
1441+
"must already be an owner to yank or unyank"
14401442
);
14411443
}
14421444

0 commit comments

Comments
 (0)