Skip to content

Commit

Permalink
start accepting crates without authorship information
Browse files Browse the repository at this point in the history
fix test

fmt
  • Loading branch information
Rustin170506 committed Mar 19, 2021
1 parent 51ca554 commit 48504b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/controllers/krate/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ fn parse_new_headers(req: &mut dyn RequestExt) -> AppResult<EncodableCrateUpload
if empty(new.license.as_ref()) && empty(new.license_file.as_ref()) {
missing.push("license");
}
if new.authors.iter().all(String::is_empty) {
missing.push("authors");
}
if !missing.is_empty() {
let message = missing_metadata_error_message(&missing);
return Err(cargo_err(&message));
Expand Down
6 changes: 3 additions & 3 deletions src/tests/krate/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ fn ignored_badges() {
}

#[test]
fn author_license_and_description_required() {
fn license_and_description_required() {
let (_, _, _, token) = TestApp::init().with_token();

let crate_to_publish = PublishBuilder::new("foo_metadata")
Expand All @@ -831,7 +831,7 @@ fn author_license_and_description_required() {
assert_eq!(response.status(), StatusCode::OK);
assert_eq!(
response.json(),
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description", "license", "authors"]) }] })
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description", "license"]) }] })
);

let crate_to_publish = PublishBuilder::new("foo_metadata")
Expand All @@ -844,7 +844,7 @@ fn author_license_and_description_required() {
assert_eq!(response.status(), StatusCode::OK);
assert_eq!(
response.json(),
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description", "authors"]) }] })
json!({ "errors": [{ "detail": missing_metadata_error_message(&["description"]) }] })
);

let crate_to_publish = PublishBuilder::new("foo_metadata")
Expand Down

0 comments on commit 48504b1

Please sign in to comment.