Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
fix specs for "generate my checklist" command
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Sep 30, 2021
1 parent 295a0e0 commit c7abae2
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 76 deletions.
12 changes: 10 additions & 2 deletions spec/support/fake_github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class FakeGitHub < Sinatra::Base
json_response 200, 'issue-940.json'
end

# Pre-review issue
# Pre-review issues
get '/repos/openjournals/joss-reviews-testing/issues/936' do
json_response 200, 'pre-review-issue-936.json'
end
Expand All @@ -35,11 +35,19 @@ class FakeGitHub < Sinatra::Base
json_response 200, 'pre-review-issue-935.json'
end

# Review issue
get '/repos/openjournals/joss-reviews-testing/issues/122' do
json_response 200, 'pre-review-issue-122.json'
end

# Review issues
get '/repos/openjournals/joss-reviews-testing/issues/937' do
json_response 200, 'review-issue-937.json'
end

get '/repos/openjournals/joss-reviews-testing/issues/121' do
json_response 200, 'review-issue-121.json'
end

post '/repos/openjournals/joss-reviews-testing/issues/937/comments' do
json_response 201, 'pre-review-issue-comment-created-937.json'
end
Expand Down
48 changes: 24 additions & 24 deletions spec/support/fixtures/generate-my-checklist-non-reviewer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@
"id": 420601978,
"node_id": "MDEyOklzc3VlQ29tbWVudDQyMDYwMTk3OA==",
"user": {
"login": "notreviewer",
"login": "nonreviewer",
"id": 4483,
"node_id": "MDQ6VXNlcjQ0ODM=",
"avatar_url": "https://avatars1.githubusercontent.com/u/4483?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/notreviewer",
"html_url": "https://github.com/notreviewer",
"followers_url": "https://api.github.com/users/notreviewer/followers",
"following_url": "https://api.github.com/users/notreviewer/following{/other_user}",
"gists_url": "https://api.github.com/users/notreviewer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/notreviewer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/notreviewer/subscriptions",
"organizations_url": "https://api.github.com/users/notreviewer/orgs",
"repos_url": "https://api.github.com/users/notreviewer/repos",
"events_url": "https://api.github.com/users/notreviewer/events{/privacy}",
"received_events_url": "https://api.github.com/users/notreviewer/received_events",
"url": "https://api.github.com/users/nonreviewer",
"html_url": "https://github.com/nonreviewer",
"followers_url": "https://api.github.com/users/nonreviewer/followers",
"following_url": "https://api.github.com/users/nonreviewer/following{/other_user}",
"gists_url": "https://api.github.com/users/nonreviewer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nonreviewer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nonreviewer/subscriptions",
"organizations_url": "https://api.github.com/users/nonreviewer/orgs",
"repos_url": "https://api.github.com/users/nonreviewer/repos",
"events_url": "https://api.github.com/users/nonreviewer/events{/privacy}",
"received_events_url": "https://api.github.com/users/nonreviewer/received_events",
"type": "User",
"site_admin": false
},
Expand Down Expand Up @@ -186,22 +186,22 @@
"description": ""
},
"sender": {
"login": "arfon",
"login": "nonreviewer",
"id": 4483,
"node_id": "MDQ6VXNlcjQ0ODM=",
"avatar_url": "https://avatars1.githubusercontent.com/u/4483?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arfon",
"html_url": "https://github.com/arfon",
"followers_url": "https://api.github.com/users/arfon/followers",
"following_url": "https://api.github.com/users/arfon/following{/other_user}",
"gists_url": "https://api.github.com/users/arfon/gists{/gist_id}",
"starred_url": "https://api.github.com/users/arfon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arfon/subscriptions",
"organizations_url": "https://api.github.com/users/arfon/orgs",
"repos_url": "https://api.github.com/users/arfon/repos",
"events_url": "https://api.github.com/users/arfon/events{/privacy}",
"received_events_url": "https://api.github.com/users/arfon/received_events",
"url": "https://api.github.com/users/nonreviewer",
"html_url": "https://github.com/nonreviewer",
"followers_url": "https://api.github.com/users/nonreviewer/followers",
"following_url": "https://api.github.com/users/nonreviewer/following{/other_user}",
"gists_url": "https://api.github.com/users/nonreviewer/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nonreviewer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nonreviewer/subscriptions",
"organizations_url": "https://api.github.com/users/nonreviewer/orgs",
"repos_url": "https://api.github.com/users/nonreviewer/repos",
"events_url": "https://api.github.com/users/nonreviewer/events{/privacy}",
"received_events_url": "https://api.github.com/users/nonreviewer/received_events",
"type": "User",
"site_admin": false
}
Expand Down
68 changes: 34 additions & 34 deletions spec/support/fixtures/generate-my-checklist-pre-review-issue.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"action": "created",
"issue": {
"url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/121",
"url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122",
"repository_url": "https://api.github.com/repos/openjournals/joss-reviews-testing",
"labels_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/121/labels{/name}",
"comments_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/121/comments",
"events_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/121/events",
"html_url": "https://github.com/openjournals/joss-reviews-testing/issues/121",
"id": 338403341,
"labels_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122/labels{/name}",
"comments_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122/comments",
"events_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122/events",
"html_url": "https://github.com/openjournals/joss-reviews-testing/issues/122",
"id": 338403342,
"node_id": "MDU6SXNzdWUzMzg0MDMzNDE=",
"number": 121,
"number": 122,
"title": "[PRE REVIEW]: Testing",
"user": {
"login": "arfon",
"login": "tester",
"id": 4483,
"node_id": "MDQ6VXNlcjQ0ODM=",
"avatar_url": "https://avatars1.githubusercontent.com/u/4483?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arfon",
"html_url": "https://github.com/arfon",
"followers_url": "https://api.github.com/users/arfon/followers",
"following_url": "https://api.github.com/users/arfon/following{/other_user}",
"gists_url": "https://api.github.com/users/arfon/gists{/gist_id}",
"starred_url": "https://api.github.com/users/arfon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arfon/subscriptions",
"organizations_url": "https://api.github.com/users/arfon/orgs",
"repos_url": "https://api.github.com/users/arfon/repos",
"events_url": "https://api.github.com/users/arfon/events{/privacy}",
"received_events_url": "https://api.github.com/users/arfon/received_events",
"url": "https://api.github.com/users/tester",
"html_url": "https://github.com/tester",
"followers_url": "https://api.github.com/users/tester/followers",
"following_url": "https://api.github.com/users/tester/following{/other_user}",
"gists_url": "https://api.github.com/users/tester/gists{/gist_id}",
"starred_url": "https://api.github.com/users/tester/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tester/subscriptions",
"organizations_url": "https://api.github.com/users/tester/orgs",
"repos_url": "https://api.github.com/users/tester/repos",
"events_url": "https://api.github.com/users/tester/events{/privacy}",
"received_events_url": "https://api.github.com/users/tester/received_events",
"type": "User",
"site_admin": false
},
Expand All @@ -46,12 +46,12 @@
"updated_at": "2018-09-12T10:46:14Z",
"closed_at": null,
"author_association": "COLLABORATOR",
"body": "**Submitting author:** @arfon (<a href=\"http://orcid.org/0000-0002-1236-5109\">Robert Gieseke</a>)\r\n**Repository:** <a href=\"https://github.com/spacetelescope/nircam_data_analysis\" target =\"_blank\">https://github.com/spacetelescope/nircam_data_analysis</a>\r\n**Version:** v1.0.1\r\n**Editor:** @arfon\r\n**Reviewers:** @reviewer1, @reviewer2\r\n\r\n**Author instructions**\r\n\r\nThanks for submitting your paper to JOSS @rgieseke. The JOSS editor (shown at the top of this issue) will work with you on this issue to find a reviewer for your submission before creating the main review issue.\r\n\r\n@rgieseke if you have any suggestions for potential reviewers then please mention them here in this thread. In addition, [this list of people](https://github.com/openjournals/joss/blob/master/docs/reviewers.csv) have already agreed to review for JOSS and may be suitable for this submission.\r\n\r\n**Editor instructions**\r\n\r\nThe JOSS submission bot @whedon is here to help you find and assign reviewers and start the main review. To find out what @whedon can do for you type:\r\n\r\n```\r\n@whedon commands\r\n```\r\n\r\n "
"body": "**Submitting author:** @tester \r\n**Repository:** <a href=\"https://github.com/spacetelescope/nircam_data_analysis\" target =\"_blank\">https://github.com/spacetelescope/nircam_data_analysis</a>\r\n**Version:** v1.0.1\r\n**Editor:** @arfon\r\n**Reviewers:** @reviewer1, @reviewer2\r\n\r\n**Editor instructions**\r\n\r\nTo find out what @whedon can do for you type:\r\n\r\n```\r\n@whedon commands\r\n```\r\n\r\n "
},
"comment": {
"url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/comments/420601978",
"html_url": "https://github.com/openjournals/joss-reviews-testing/issues/121#issuecomment-420601978",
"issue_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/121",
"html_url": "https://github.com/openjournals/joss-reviews-testing/issues/122#issuecomment-420601978",
"issue_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122",
"id": 420601978,
"node_id": "MDEyOklzc3VlQ29tbWVudDQyMDYwMTk3OA==",
"user": {
Expand Down Expand Up @@ -186,22 +186,22 @@
"description": ""
},
"sender": {
"login": "arfon",
"login": "reviewer1",
"id": 4483,
"node_id": "MDQ6VXNlcjQ0ODM=",
"avatar_url": "https://avatars1.githubusercontent.com/u/4483?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arfon",
"html_url": "https://github.com/arfon",
"followers_url": "https://api.github.com/users/arfon/followers",
"following_url": "https://api.github.com/users/arfon/following{/other_user}",
"gists_url": "https://api.github.com/users/arfon/gists{/gist_id}",
"starred_url": "https://api.github.com/users/arfon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arfon/subscriptions",
"organizations_url": "https://api.github.com/users/arfon/orgs",
"repos_url": "https://api.github.com/users/arfon/repos",
"events_url": "https://api.github.com/users/arfon/events{/privacy}",
"received_events_url": "https://api.github.com/users/arfon/received_events",
"url": "https://api.github.com/users/reviewer1",
"html_url": "https://github.com/reviewer1",
"followers_url": "https://api.github.com/users/reviewer1/followers",
"following_url": "https://api.github.com/users/reviewer1/following{/other_user}",
"gists_url": "https://api.github.com/users/reviewer1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/reviewer1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reviewer1/subscriptions",
"organizations_url": "https://api.github.com/users/reviewer1/orgs",
"repos_url": "https://api.github.com/users/reviewer1/repos",
"events_url": "https://api.github.com/users/reviewer1/events{/privacy}",
"received_events_url": "https://api.github.com/users/reviewer1/received_events",
"type": "User",
"site_admin": false
}
Expand Down
26 changes: 13 additions & 13 deletions spec/support/fixtures/generate-my-checklist.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"updated_at": "2018-09-12T10:46:14Z",
"closed_at": null,
"author_association": "COLLABORATOR",
"body": "**Submitting author:** @arfon (<a href=\"http://orcid.org/0000-0002-1236-5109\">Robert Gieseke</a>)\r\n**Repository:** <a href=\"https://github.com/spacetelescope/nircam_data_analysis\" target =\"_blank\">https://github.com/spacetelescope/nircam_data_analysis</a>\r\n**Version:** v1.0.1\r\n**Editor:** @arfon\r\n**Reviewers:** @reviewer1, @reviewer2\r\n\r\n**Author instructions**\r\n\r\nThanks for submitting your paper to JOSS @rgieseke. The JOSS editor (shown at the top of this issue) will work with you on this issue to find a reviewer for your submission before creating the main review issue.\r\n\r\n@rgieseke if you have any suggestions for potential reviewers then please mention them here in this thread. In addition, [this list of people](https://github.com/openjournals/joss/blob/master/docs/reviewers.csv) have already agreed to review for JOSS and may be suitable for this submission.\r\n\r\n**Editor instructions**\r\n\r\nThe JOSS submission bot @whedon is here to help you find and assign reviewers and start the main review. To find out what @whedon can do for you type:\r\n\r\n```\r\n@whedon commands\r\n```\r\n\r\n "
"body": "**Submitting author:** @arfon \r\n**Repository:** <a href=\"https://github.com/spacetelescope/nircam_data_analysis\" target =\"_blank\">https://github.com/spacetelescope/nircam_data_analysis</a>\r\n**Version:** v1.0.1\r\n**Editor:** @arfon\r\n**Reviewers:** @reviewer1, @reviewer2\r\n\r\n**Editor instructions**\r\n\r\nTo find out what @whedon can do for you type:\r\n\r\n```\r\n@whedon commands\r\n```\r\n\r\n "
},
"comment": {
"url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/comments/420601978",
Expand Down Expand Up @@ -186,22 +186,22 @@
"description": ""
},
"sender": {
"login": "arfon",
"login": "reviewer1",
"id": 4483,
"node_id": "MDQ6VXNlcjQ0ODM=",
"avatar_url": "https://avatars1.githubusercontent.com/u/4483?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/arfon",
"html_url": "https://github.com/arfon",
"followers_url": "https://api.github.com/users/arfon/followers",
"following_url": "https://api.github.com/users/arfon/following{/other_user}",
"gists_url": "https://api.github.com/users/arfon/gists{/gist_id}",
"starred_url": "https://api.github.com/users/arfon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arfon/subscriptions",
"organizations_url": "https://api.github.com/users/arfon/orgs",
"repos_url": "https://api.github.com/users/arfon/repos",
"events_url": "https://api.github.com/users/arfon/events{/privacy}",
"received_events_url": "https://api.github.com/users/arfon/received_events",
"url": "https://api.github.com/users/reviewer1",
"html_url": "https://github.com/reviewer1",
"followers_url": "https://api.github.com/users/reviewer1/followers",
"following_url": "https://api.github.com/users/reviewer1/following{/other_user}",
"gists_url": "https://api.github.com/users/reviewer1/gists{/gist_id}",
"starred_url": "https://api.github.com/users/reviewer1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/reviewer1/subscriptions",
"organizations_url": "https://api.github.com/users/reviewer1/orgs",
"repos_url": "https://api.github.com/users/reviewer1/repos",
"events_url": "https://api.github.com/users/reviewer1/events{/privacy}",
"received_events_url": "https://api.github.com/users/reviewer1/received_events",
"type": "User",
"site_admin": false
}
Expand Down
48 changes: 48 additions & 0 deletions spec/support/fixtures/pre-review-issue-122.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122",
"repository_url": "https://api.github.com/repos/openjournals/joss-reviews-testing",
"labels_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122/labels{/name}",
"comments_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122/comments",
"events_url": "https://api.github.com/repos/openjournals/joss-reviews-testing/issues/122/events",
"html_url": "https://github.com/openjournals/joss-reviews-testing/issues/122",
"id": 338403342,
"node_id": "MDU6SXNzdWUzMzg0MDMzNDE=",
"number": 122,
"title": "[PRE REVIEW]: Testing",
"user": {
"login": "tester",
"id": 4483,
"node_id": "MDQ6VXNlcjQ0ODM=",
"avatar_url": "https://avatars1.githubusercontent.com/u/4483?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/tester",
"html_url": "https://github.com/tester",
"followers_url": "https://api.github.com/users/tester/followers",
"following_url": "https://api.github.com/users/tester/following{/other_user}",
"gists_url": "https://api.github.com/users/tester/gists{/gist_id}",
"starred_url": "https://api.github.com/users/tester/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tester/subscriptions",
"organizations_url": "https://api.github.com/users/tester/orgs",
"repos_url": "https://api.github.com/users/tester/repos",
"events_url": "https://api.github.com/users/tester/events{/privacy}",
"received_events_url": "https://api.github.com/users/tester/received_events",
"type": "User",
"site_admin": false
},
"labels": [

],
"state": "open",
"locked": false,
"assignee": null,
"assignees": [

],
"milestone": null,
"comments": 4,
"created_at": "2018-07-05T01:54:30Z",
"updated_at": "2018-09-12T10:46:14Z",
"closed_at": null,
"author_association": "COLLABORATOR",
"body": "**Submitting author:** @tester \r\n**Repository:** <a href=\"https://github.com/spacetelescope/nircam_data_analysis\" target =\"_blank\">https://github.com/spacetelescope/nircam_data_analysis</a>\r\n**Version:** v1.0.1\r\n**Editor:** @arfon\r\n**Reviewers:** @reviewer1, @reviewer2\r\n\r\n**Editor instructions**\r\n\r\nTo find out what @whedon can do for you type:\r\n\r\n```\r\n@whedon commands\r\n```\r\n\r\n "
}
Loading

0 comments on commit c7abae2

Please sign in to comment.