-
Notifications
You must be signed in to change notification settings - Fork 644
Stop showing documentation link when documentation is removed from Cargo.toml #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f10bcb5
Fixes #945
sunjay b73a797
Fixed clippy errors
sunjay 19bd9fd
Merge remote-tracking branch 'upstream/master' into sunjay-master
carols10cents adb0715
Have the test fn req_with_documentation always take documentation
carols10cents 59da18d
rustfmt
carols10cents File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"request":{"uri":"http://alexcrichton-test.s3.amazonaws.com/crates/docscrate/docscrate-0.2.1.crate","method":"PUT","headers":[["Proxy-Connection","Keep-Alive"],["Content-Type","application/x-tar"],["Accept","*/*"],["Date","Fri, 15 Sep 2017 07:53:06 -0700"],["Authorization","AWS AKIAICL5IWUZYWWKA7JA:RkpxRf+NUDyzjWrEMc1ikasbtZI="],["Content-Length","35"],["Host","alexcrichton-test.s3.amazonaws.com"]],"body":[31,139,8,0,0,0,0,0,0,255,237,192,1,1,0,0,0,130,32,255,175,110,72,80,192,171,1,46,175,181,239,0,4,0,0]},"response":{"status":200,"headers":[["ETag","\"f9016ad360cebb4fe2e6e96e5949f022\""],["Content-Length","0"],["Date","Fri, 15 Sep 2017 14:53:07 GMT"],["x-amz-id-2","Es2wWCc+tXkMbbp+bEcjLFQn6yGqPeAUiBI5XqXZ8mAZUIpe7vYiCfBfoU727trNpEFMymyhgZY="],["Server","AmazonS3"],["x-amz-request-id","98298F12367C7A0B"]],"body":[]}},{"request":{"uri":"http://alexcrichton-test.s3.amazonaws.com/crates/docscrate/docscrate-0.2.2.crate","method":"PUT","headers":[["Date","Fri, 15 Sep 2017 07:53:06 -0700"],["Authorization","AWS AKIAICL5IWUZYWWKA7JA:umuWs3XoGqsDipgMq04QAhq9Spc="],["Content-Type","application/x-tar"],["Host","alexcrichton-test.s3.amazonaws.com"],["Accept","*/*"],["Proxy-Connection","Keep-Alive"],["Content-Length","35"]],"body":[31,139,8,0,0,0,0,0,0,255,237,192,1,1,0,0,0,130,32,255,175,110,72,80,192,171,1,46,175,181,239,0,4,0,0]},"response":{"status":200,"headers":[["x-amz-request-id","2E4EDB9109077234"],["x-amz-id-2","gnBA5fngpIAF7AVe+goe2YZkL6gB7yRp25LNjBl7wqyMNeIXGMLTyWd/46bkoVNv/S9t9BZ5IB4="],["ETag","\"f9016ad360cebb4fe2e6e96e5949f022\""],["Date","Fri, 15 Sep 2017 14:53:07 GMT"],["Server","AmazonS3"],["Content-Length","0"]],"body":[]}}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1573,6 +1573,66 @@ fn publish_after_yank_max_version() { | |
assert_eq!(json.krate.max_version, "2.0.0"); | ||
} | ||
|
||
#[test] | ||
fn publish_after_removing_documentation() { | ||
let (_b, app, middle) = ::app(); | ||
|
||
let user; | ||
|
||
// 1. Start with a crate with no documentation | ||
{ | ||
let conn = app.diesel_database.get().unwrap(); | ||
user = ::new_user("foo").create_or_update(&conn).unwrap(); | ||
::CrateBuilder::new("docscrate", user.id) | ||
.version("0.2.0") | ||
.expect_build(&conn); | ||
} | ||
|
||
// Verify that crates start without any documentation so the next assertion can *prove* | ||
// that it was the one that added the documentation | ||
{ | ||
let mut req = ::req(Arc::clone(&app), Method::Get, "/api/v1/crates/docscrate"); | ||
let mut response = ok_resp!(middle.call(&mut req)); | ||
let json: CrateResponse = ::json(&mut response); | ||
assert_eq!(json.krate.documentation, None); | ||
} | ||
|
||
// 2. Add documentation | ||
{ | ||
let mut req = | ||
::new_req_with_documentation(Arc::clone(&app), "docscrate", "0.2.1", "http://foo.rs"); | ||
::sign_in_as(&mut req, &user); | ||
let mut response = ok_resp!(middle.call(&mut req)); | ||
let json: GoodCrate = ::json(&mut response); | ||
assert_eq!(json.krate.documentation, Some("http://foo.rs".to_owned())); | ||
} | ||
|
||
// Ensure latest version also has the same documentation | ||
{ | ||
let mut req = ::req(Arc::clone(&app), Method::Get, "/api/v1/crates/docscrate"); | ||
let mut response = ok_resp!(middle.call(&mut req)); | ||
let json: CrateResponse = ::json(&mut response); | ||
assert_eq!(json.krate.documentation, Some("http://foo.rs".to_owned())); | ||
} | ||
|
||
// 3. Remove the documentation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And again, imo lines 1637-1691 are not providing any additional coverage. Please remove, thank you! |
||
{ | ||
let mut req = ::new_req(Arc::clone(&app), "docscrate", "0.2.2"); | ||
::sign_in_as(&mut req, &user); | ||
let mut response = ok_resp!(middle.call(&mut req)); | ||
let json: GoodCrate = ::json(&mut response); | ||
assert_eq!(json.krate.documentation, None); | ||
} | ||
|
||
// Ensure latest version no longer has documentation | ||
{ | ||
let mut req = ::req(Arc::clone(&app), Method::Get, "/api/v1/crates/docscrate"); | ||
let mut response = ok_resp!(middle.call(&mut req)); | ||
let json: CrateResponse = ::json(&mut response); | ||
assert_eq!(json.krate.documentation, None); | ||
} | ||
} | ||
|
||
#[test] | ||
fn bad_keywords() { | ||
let (_b, app, middle) = ::app(); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, this block (L1568-1575) tests the same thing that the previous test does in L1464-1471. I can't think of a scenario where one of them would pass and the other would fail. Could you remove this block please?