octokit 1.25.0 → 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +10 -7
- data/lib/octokit.rb +22 -15
- data/lib/octokit/arguments.rb +14 -0
- data/lib/octokit/authentication.rb +48 -25
- data/lib/octokit/client.rb +245 -44
- data/lib/octokit/client/authorizations.rb +36 -10
- data/lib/octokit/client/commit_comments.rb +96 -0
- data/lib/octokit/client/commits.rb +152 -94
- data/lib/octokit/client/contents.rb +32 -24
- data/lib/octokit/client/downloads.rb +11 -7
- data/lib/octokit/client/emojis.rb +3 -1
- data/lib/octokit/client/events.rb +62 -18
- data/lib/octokit/client/gists.rb +27 -26
- data/lib/octokit/client/gitignore.rb +7 -3
- data/lib/octokit/client/issues.rb +43 -71
- data/lib/octokit/client/labels.rb +24 -20
- data/lib/octokit/client/legacy_search.rb +78 -0
- data/lib/octokit/client/markdown.rb +6 -1
- data/lib/octokit/client/meta.rb +21 -0
- data/lib/octokit/client/milestones.rb +13 -9
- data/lib/octokit/client/notifications.rb +24 -64
- data/lib/octokit/client/objects.rb +17 -12
- data/lib/octokit/client/organizations.rb +43 -52
- data/lib/octokit/client/pub_sub_hubbub.rb +68 -8
- data/lib/octokit/client/{pulls.rb → pull_requests.rb} +65 -41
- data/lib/octokit/client/rate_limit.rb +42 -8
- data/lib/octokit/client/refs.rb +16 -10
- data/lib/octokit/client/repositories.rb +73 -124
- data/lib/octokit/client/say.rb +7 -1
- data/lib/octokit/client/service_status.rb +39 -0
- data/lib/octokit/client/stats.rb +12 -6
- data/lib/octokit/client/statuses.rb +8 -29
- data/lib/octokit/client/users.rb +56 -75
- data/lib/octokit/configurable.rb +117 -0
- data/lib/octokit/default.rb +140 -0
- data/lib/octokit/error.rb +6 -5
- data/lib/octokit/gist.rb +11 -0
- data/lib/octokit/rate_limit.rb +22 -0
- data/lib/octokit/repo_arguments.rb +19 -0
- data/lib/octokit/repository.rb +11 -4
- data/lib/octokit/response/raise_error.rb +35 -0
- data/lib/octokit/version.rb +5 -1
- data/octokit.gemspec +4 -9
- data/spec/cassettes/Octokit_Client/_get/handles_query_params.json +1 -0
- data/spec/cassettes/Octokit_Client/_head/handles_query_params.json +1 -0
- data/spec/cassettes/Octokit_Client/_last_response/caches_the_last_agent_response.json +1 -0
- data/spec/cassettes/Octokit_Client/authentication/when_token_authenticated/fetches_and_memoizes_login.json +1 -0
- data/spec/cassettes/Octokit_Client/auto_pagination/fetches_all_the_pages.json +1 -0
- data/spec/cassettes/Octokit_Client/error_handling/raises_on_404.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_authorization/returns_a_single_authorization.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_authorizations/lists_existing_authorizations.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_a_new_authorization_with_options.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_create_authorization/creates_an_API_authorization.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_a_one-off_token.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_scopes/checks_the_scopes_on_the_current_token.json +1 -0
- data/spec/cassettes/Octokit_Client_Authorizations/_update_authorization/updates_and_existing_authorization.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_commit_comment/returns_a_single_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_commit_comments/returns_a_list_of_comments_for_a_specific_commit.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_create_commit_comment/creates_a_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_delete_commit_comment/deletes_a_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_list_commit_comments/returns_a_list_of_all_commit_comments.json +1 -0
- data/spec/cassettes/Octokit_Client_CommitComments/_update_commit_comment/updates_a_commit_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commit/returns_a_commit.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits/returns_all_commits.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_before/returns_all_commits_until_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_between/returns_all_commits_until_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_on/returns_all_commits_on_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_branch_or_sha_argument.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/handles_the_sha_option.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_commits_since/returns_all_commits_since_the_specified_date.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_compare/returns_a_comparison.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_create_commit/creates_a_commit.json +1 -0
- data/spec/cassettes/Octokit_Client_Commits/_merge/merges_a_branch_into_another.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_archive_link/returns_the_headers_of_the_request.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_contents/returns_the_contents_of_a_file.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_File_object.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_contents_from_file_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_create_contents/creates_repository_contents_at_a_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_delete_contents/deletes_repository_contents_at_a_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_readme/returns_the_default_readme.json +1 -0
- data/spec/cassettes/Octokit_Client_Contents/_update_contents/updates_repository_contents_at_a_path.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/_download/gets_a_single_download.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/_downloads/lists_available_downloads.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/creates_a_download_resource.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_create_download/posts_to_an_S3_url.json +1 -0
- data/spec/cassettes/Octokit_Client_Downloads/methods_that_require_a_download/_delete_download/deletes_a_download.json +1 -0
- data/spec/cassettes/Octokit_Client_Emojis/_emojis/returns_all_github_emojis.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_issue_event/lists_issue_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_issue_events/lists_issue_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_organization_events/returns_all_events_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_organization_public_events/returns_an_organization_s_public_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_public_events/returns_all_public_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_received_events/returns_all_user_received_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_received_public_events/returns_public_user_received_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_repo_issue_events/lists_issue_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_repository_events/returns_events_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_repository_network_events/returns_events_for_a_repository_s_network.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_user_events/returns_all_user_events.json +1 -0
- data/spec/cassettes/Octokit_Client_Events/_user_public_events/returns_public_events_performed_by_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gist/returns_the_gist_by_ID.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/with_username_passed/returns_a_list_of_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_gists/without_a_username_passed/returns_a_list_of_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/unauthenticated/_public_gists/returns_public_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist/creates_a_new_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_create_gist_comment/creates_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist/deletes_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_delete_gist_comment/deletes_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_edit_gist/edit_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_fork_gist/forks_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comment/returns_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_comments/returns_the_list_of_gist_comments.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_not_starred.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gist_starred_/is_starred.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_gists/returns_a_list_of_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_star_gist/stars_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_starred_gists/returns_the_user_s_starred_gists.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_unstar_gist/unstars_an_existing_gist.json +1 -0
- data/spec/cassettes/Octokit_Client_Gists/when_authenticated/_update_gist_comment/updates_a_gist_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_template/returns_the_ruby_gitignore_template.json +1 -0
- data/spec/cassettes/Octokit_Client_Gitignore/_gitignore_templates/returns_all_gitignore_templates.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_delimited_labels.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_create_issue/creates_an_issue_with_labels_array.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_issue_comment/returns_a_single_comment_for_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_issue_comments/returns_comments_for_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_dashboard_issues_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_list_issues/returns_issues_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_org_issues/returns_issues_for_the_organization_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_repository_issues_comments/returns_comments_for_all_issues_in_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/_user_issues/returns_issues_for_the_authenticated_user_for_owned_and_member_repos.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_add_comment/adds_a_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_close_issue/closes_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_a_full_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_issue/returns_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_reopen_issue/reopens_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/_update_issue/updates_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/methods_requiring_a_new_issue_comment/_delete_comment/deletes_an_existing_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Issues/methods_requiring_a_new_issue/methods_requiring_a_new_issue_comment/_update_comment/updates_an_existing_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_a_color.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_add_label/adds_a_label_with_default_color.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_delete_label_/deletes_a_label_from_the_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_label/returns_a_single_label.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_labels/returns_labels.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/_lables_for_milestone/returns_all_labels_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_add_labels_to_an_issue/adds_labels_to_a_given_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_labels_for_issue/returns_all_labels_for_a_given_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_all_labels/removes_all_labels_from_the_specified_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_remove_label/removes_a_label_from_the_specified_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_issue/_replace_all_labels/replaces_all_labels_for_an_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_Labels/methods_requiring_a_new_label/_update_label/updates_a_label_with_a_new_color.json +1 -0
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_issues/returns_matching_issues.json +1 -0
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_repos/returns_matching_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_LegacySearch/_legacy_search_users/returns_matching_username.json +1 -0
- data/spec/cassettes/Octokit_Client_Markdown/_markdown/renders_markdown.json +1 -0
- data/spec/cassettes/Octokit_Client_Meta/_github_meta/returns_meta_information_about_github.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/_list_milestones/lists_milestones_belonging_to_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_create_milestone/creates_a_milestone.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_delete_milestone/deletes_a_milestone_from_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_milestone/gets_a_single_milestone_belonging_to_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Milestones/methods_that_need_a_milestone/_update_milestone/updates_a_milestone.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/_mark_notifications_as_read/returns_true_when_notifications_are_marked_as_read.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/_mark_repository_notifications_as_read/returns_true_when_notifications_for_a_repo_are_marked_as_read.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/_notifications/lists_the_notifications_for_the_current_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/_repository_notifications/lists_all_notifications_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_delete_thread_subscription/returns_true_with_successful_thread_deletion.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_mark_thread_as_read/marks_a_thread_as_read.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_notifications/returns_notifications_for_a_specific_thread.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_thread_subscription/returns_a_thread_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Notifications/methods_that_need_a_thread_context/_update_thread_subscription/updates_a_thread_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_blob/returns_a_blob.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_create_blob/creates_a_blob.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_create_tag/creates_a_tag.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_create_tree/creates_a_tree.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_tag/returns_a_tag.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree.json +1 -0
- data/spec/cassettes/Octokit_Client_Objects/_tree/gets_a_tree_recursively.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization/returns_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_member_/checks_organization_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_members/returns_all_public_members_of_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_public_member_/checks_publicized_org_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_repositories/returns_all_public_repositories_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organization_teams/returns_all_teams_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_organizations/returns_all_organizations_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/_update_organization/updates_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_member/adds_a_team_member.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_add_team_repository/adds_a_team_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_create_team/creates_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_delete_team/deletes_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_publicize_membership/publicizes_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_member/removes_a_team_member.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_remove_team_repository/removes_a_team_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team/returns_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_member_/checks_if_a_user_is_member_of_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_members/returns_team_members.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_team_repositories/returns_team_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_unpublicize_membership/unpublicizes_membership.json +1 -0
- data/spec/cassettes/Octokit_Client_Organizations/methods_that_require_a_new_team/_update_team/updates_a_team.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/raises_an_error_when_topic_is_not_recognized.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe/subscribes_to_pull_events.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_subscribe_service_hook/subscribes_to_pull_events_on_specified_topic.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/_unsubscribe/unsubscribes_from_pull_events.json +1 -0
- data/spec/cassettes/Octokit_Client_PubSubHubbub/unsubscribe_service_hook/unsubscribes_to_stop_receiving_events_on_specified_topic.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_create_pull_request_for_issue/creates_a_pull_request_and_attach_it_to_an_existing_issue.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comment/returns_a_comment_on_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_comments/returns_the_comments_for_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_commits/returns_the_commits_for_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_request_files/lists_files_for_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests/returns_all_pull_requests.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/_pull_requests_comments/returns_all_comments_on_all_pull_requests.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_close_pull_request/closes_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_create_pull_request/creates_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_merge_pull_request/merges_the_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_merged_/returns_whether_the_pull_request_has_been_merged.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_pull_request/returns_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/_update_pull_request/updates_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_create_pull_request_comment/creates_a_new_comment_on_a_pull_request.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_create_pull_request_comment_reply/creates_a_new_reply_to_a_pull_request_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_delete_pull_request_comment/deletes_a_pull_request_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_PullRequests/methods_that_require_a_new_pull/methods_requiring_a_pull_request_comment/_update_pull_request_comment/updates_a_pull_request_comment.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/_ref/returns_a_tags_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_refs.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/_refs/returns_all_tag_refs.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_create_ref/creates_a_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_delete_ref/deletes_an_existing_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Refs/methods_that_require_a_ref/_update_ref/updates_a_ref.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_all_repositories/returns_all_repositories_on_github.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_assignees/lists_all_the_available_assignees_owner_collaborators_.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_repository_s_branches.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_branches/returns_a_single_branch.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_check_assignee/checks_to_see_if_a_particular_user_is_an_assignee_for_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_collaborators/returns_a_repository_s_collaborators.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_contributors/returns_repository_contributors_excluding_anonymous.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_create_repository/creates_a_repository_for_an_organization.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_delete_subscription/returns_true_when_repo_subscription_deleted.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_fork/forks_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_languages/returns_a_repository_s_languages.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_network/returns_a_repository_s_network.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_a_user_s_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repositories/returns_authenticated_user_s_repositories.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repository/returns_the_matching_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_false_if_the_repository_doesn_t_exist.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_repository_/returns_true_if_the_repository_exists.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_star/stars_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_stargazers/returns_all_repository_stargazers.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_subscribers/lists_all_the_users_watching_the_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_subscription/returns_a_repository_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_tags/returns_a_repository_s_tags.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_unstar/unstars_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_unwatch/unwatches_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_update_subscription/updates_a_repository_subscription.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_watch/watches_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/_watchers/returns_all_repository_watchers.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_add_collaborator/adds_a_repository_collaborators.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_create_repository/creates_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_delete_repository/deletes_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_deploy_keys/returns_a_repository_s_deploy_keys.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_hooks/returns_a_repository_s_hooks.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_remove_collaborator/removes_a_repository_collaborators.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_repository_teams/returns_all_repository_teams.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/_update_repository/updates_the_matching_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_requiring_an_existing_deploy_key/_add_deploy_key/adds_a_repository_deploy_keys.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_create_hook/creates_a_hook.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_edit_hook/edits_a_hook.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_hook/returns_a_repository_s_single_hook.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_remove_hook/removes_a_hook.json +1 -0
- data/spec/cassettes/Octokit_Client_Repositories/methods_that_require_a_new_repo/methods_that_need_an_existing_hook/_test_hook/tests_a_hook.json +1 -0
- data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat.json +1 -0
- data/spec/cassettes/Octokit_Client_Say/_say/returns_an_ASCII_octocat_with_custom_text.json +1 -0
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_current_system_status.json +1 -0
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status/returns_the_most_recent_status_messages.json +1 -0
- data/spec/cassettes/Octokit_Client_ServiceStatus/_github_status_last_message/returns_the_last_human_message.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_code_frequency_stats/returns_the_code_frequency_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_commit_activity_stats/returns_the_commit_activity_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_contributors_stats/returns_contributors_and_their_contribution_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_participation_stats/returns_the_owner_and_contributor_participation_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Stats/_punch_card_stats/returns_commit_count_by_hour_punch_card_stats.json +1 -0
- data/spec/cassettes/Octokit_Client_Statuses/_create_status/creates_status.json +1 -0
- data/spec/cassettes/Octokit_Client_Statuses/_statuses/lists_commit_statuses.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_add_email/adds_an_email_address.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_all_users/returns_all_GitHub_users.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_emails/returns_email_addresses.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_follow/follows_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_followers/returns_followers_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_followers/returns_the_authenticated_user_s_followers.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_following/returns_following_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_following/returns_the_authenticated_user_s_following.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_follows_/checks_if_the_authenticated_user_follows_another.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_keys/returns_public_keys_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_remove_email/removes_an_email_address.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_starred/returns_starred_repositories_for_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_starred_/checks_if_the_authenticated_user_has_starred_a_repository.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_a_user_watches_for_notifications.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_subscriptions/returns_the_repositories_the_authenticated_user_watches_for_notifications.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_unfollow/unfollows_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_update_user/updates_a_user_profile.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_user/returns_a_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_user/returns_the_authenticated_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_user_keys/returns_public_keys_for_another_user.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/_validate_credentials/validates_username_and_password.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_add_key/adds_a_public_key.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_key/returns_a_public_key.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_remove_key/removes_a_public_key.json +1 -0
- data/spec/cassettes/Octokit_Client_Users/methods_requiring_an_existing_public_key/_update_key/updates_a_public_key.json +1 -0
- data/spec/cassettes/delete_authorization.json +1 -0
- data/spec/cassettes/rate_limit.json +1 -0
- data/spec/cassettes/root.json +1 -0
- data/spec/fixtures/user.json +29 -18
- data/spec/fixtures/{user_token.json → web_flow_token.json} +0 -0
- data/spec/helper.rb +49 -22
- data/spec/octokit/client/authorizations_spec.rb +69 -80
- data/spec/octokit/client/commit_comments_spec.rb +62 -0
- data/spec/octokit/client/commits_spec.rb +93 -226
- data/spec/octokit/client/contents_spec.rb +64 -119
- data/spec/octokit/client/downloads_spec.rb +34 -38
- data/spec/octokit/client/emojis_spec.rb +5 -11
- data/spec/octokit/client/events_spec.rb +67 -51
- data/spec/octokit/client/gists_spec.rb +148 -142
- data/spec/octokit/client/gitignore_spec.rb +11 -14
- data/spec/octokit/client/issues_spec.rb +129 -161
- data/spec/octokit/client/labels_spec.rb +81 -114
- data/spec/octokit/client/legacy_search_spec.rb +42 -0
- data/spec/octokit/client/markdown_spec.rb +9 -12
- data/spec/octokit/client/meta_spec.rb +14 -0
- data/spec/octokit/client/milestones_spec.rb +40 -48
- data/spec/octokit/client/notifications_spec.rb +57 -113
- data/spec/octokit/client/objects_spec.rb +36 -74
- data/spec/octokit/client/organizations_spec.rb +140 -262
- data/spec/octokit/client/pub_sub_hubbub_spec.rb +58 -49
- data/spec/octokit/client/pull_requests_spec.rb +186 -0
- data/spec/octokit/client/rate_limit_spec.rb +40 -0
- data/spec/octokit/client/refs_spec.rb +47 -56
- data/spec/octokit/client/repositories_spec.rb +301 -438
- data/spec/octokit/client/say_spec.rb +8 -22
- data/spec/octokit/client/service_status_spec.rb +37 -0
- data/spec/octokit/client/stats_spec.rb +82 -32
- data/spec/octokit/client/statuses_spec.rb +11 -51
- data/spec/octokit/client/users_spec.rb +144 -348
- data/spec/octokit/client_spec.rb +345 -195
- data/spec/octokit/rate_limit_spec.rb +25 -0
- data/spec/octokit_spec.rb +31 -15
- metadata +585 -387
- data/lib/faraday/response/raise_octokit_error.rb +0 -25
- data/lib/octokit/client/github.rb +0 -19
- data/lib/octokit/client/pub_sub_hubbub/service_hooks.rb +0 -37
- data/lib/octokit/configuration.rb +0 -77
- data/lib/octokit/connection.rb +0 -53
- data/lib/octokit/request.rb +0 -110
- data/spec/faraday/response_spec.rb +0 -63
- data/spec/fixtures/all_repositories.json +0 -122
- data/spec/fixtures/all_users.json +0 -34
- data/spec/fixtures/authorization.json +0 -16
- data/spec/fixtures/authorizations.json +0 -66
- data/spec/fixtures/blob.json +0 -7
- data/spec/fixtures/blob_create.json +0 -3
- data/spec/fixtures/branches.json +0 -16
- data/spec/fixtures/code_frequency_stats.json +0 -897
- data/spec/fixtures/collaborators.json +0 -62
- data/spec/fixtures/comment.json +0 -14
- data/spec/fixtures/comments.json +0 -44
- data/spec/fixtures/commit.json +0 -50
- data/spec/fixtures/commit_activity_stats.json +0 -678
- data/spec/fixtures/commit_comment.json +0 -19
- data/spec/fixtures/commit_comment_create.json +0 -19
- data/spec/fixtures/commit_comment_update.json +0 -19
- data/spec/fixtures/commit_comments.json +0 -78
- data/spec/fixtures/commit_create.json +0 -25
- data/spec/fixtures/commits.json +0 -1414
- data/spec/fixtures/compare.json +0 -98
- data/spec/fixtures/contents.json +0 -14
- data/spec/fixtures/contributor_stats.json +0 -2196
- data/spec/fixtures/contributors.json +0 -891
- data/spec/fixtures/create_content.json +0 -44
- data/spec/fixtures/delete_content.json +0 -30
- data/spec/fixtures/download.json +0 -11
- data/spec/fixtures/download_create.json +0 -21
- data/spec/fixtures/downloads.json +0 -35
- data/spec/fixtures/emails.json +0 -4
- data/spec/fixtures/emojis.json +0 -500
- data/spec/fixtures/followers.json +0 -212
- data/spec/fixtures/following.json +0 -209
- data/spec/fixtures/forks.json +0 -872
- data/spec/fixtures/gist.json +0 -51
- data/spec/fixtures/gist_comment.json +0 -19
- data/spec/fixtures/gist_comment_create.json +0 -19
- data/spec/fixtures/gist_comment_update.json +0 -19
- data/spec/fixtures/gist_comments.json +0 -40
- data/spec/fixtures/gists.json +0 -548
- data/spec/fixtures/github_meta.json +0 -9
- data/spec/fixtures/github_status.json +0 -4
- data/spec/fixtures/github_status_last_message.json +0 -5
- data/spec/fixtures/github_status_messages.json +0 -12
- data/spec/fixtures/gitignore_template_ruby.json +0 -4
- data/spec/fixtures/gitignore_templates.json +0 -78
- data/spec/fixtures/hook.json +0 -18
- data/spec/fixtures/hooks.json +0 -70
- data/spec/fixtures/issue.json +0 -35
- data/spec/fixtures/issue_closed.json +0 -35
- data/spec/fixtures/issue_event.json +0 -42
- data/spec/fixtures/issue_events.json +0 -72
- data/spec/fixtures/issue_full.json +0 -38
- data/spec/fixtures/issues.json +0 -1562
- data/spec/fixtures/label.json +0 -5
- data/spec/fixtures/labels.json +0 -17
- data/spec/fixtures/languages.json +0 -5
- data/spec/fixtures/legacy/issues.json +0 -49
- data/spec/fixtures/legacy/repositories.json +0 -173
- data/spec/fixtures/legacy/users.json +0 -24
- data/spec/fixtures/list_commit_comments.json +0 -572
- data/spec/fixtures/markdown_gfm +0 -1
- data/spec/fixtures/merge.json +0 -47
- data/spec/fixtures/milestone.json +0 -11
- data/spec/fixtures/milestones.json +0 -28
- data/spec/fixtures/not_found.json +0 -3
- data/spec/fixtures/notification_thread.json +0 -32
- data/spec/fixtures/notifications.json +0 -32
- data/spec/fixtures/org_issues.json +0 -710
- data/spec/fixtures/organization-repositories.json +0 -4292
- data/spec/fixtures/organization-repository.json +0 -42
- data/spec/fixtures/organization.json +0 -18
- data/spec/fixtures/organization_events.json +0 -61
- data/spec/fixtures/organization_members.json +0 -576
- data/spec/fixtures/organization_public_events.json +0 -61
- data/spec/fixtures/organization_team_members.json +0 -16
- data/spec/fixtures/organization_team_repos.json +0 -62
- data/spec/fixtures/organizations.json +0 -44
- data/spec/fixtures/participation_stats.json +0 -110
- data/spec/fixtures/public_events.json +0 -1104
- data/spec/fixtures/public_gists.json +0 -968
- data/spec/fixtures/public_key.json +0 -5
- data/spec/fixtures/public_key_update.json +0 -5
- data/spec/fixtures/public_keys.json +0 -7
- data/spec/fixtures/pull_created.json +0 -138
- data/spec/fixtures/pull_request.json +0 -138
- data/spec/fixtures/pull_request_comment.json +0 -35
- data/spec/fixtures/pull_request_comment_create.json +0 -35
- data/spec/fixtures/pull_request_comment_reply.json +0 -35
- data/spec/fixtures/pull_request_comment_update.json +0 -35
- data/spec/fixtures/pull_request_comments.json +0 -35
- data/spec/fixtures/pull_request_commits.json +0 -45
- data/spec/fixtures/pull_request_files.json +0 -35
- data/spec/fixtures/pull_request_merged.json +0 -5
- data/spec/fixtures/pull_requests.json +0 -187
- data/spec/fixtures/pull_requests_comments.json +0 -82
- data/spec/fixtures/pull_update.json +0 -138
- data/spec/fixtures/punch_card_stats.json +0 -842
- data/spec/fixtures/readme.json +0 -14
- data/spec/fixtures/ref.json +0 -9
- data/spec/fixtures/ref_create.json +0 -29
- data/spec/fixtures/ref_update.json +0 -11
- data/spec/fixtures/refs.json +0 -38
- data/spec/fixtures/refs_tags.json +0 -29
- data/spec/fixtures/repo_assignees.json +0 -30
- data/spec/fixtures/repo_events.json +0 -1652
- data/spec/fixtures/repo_issues_events.json +0 -128
- data/spec/fixtures/repositories.json +0 -872
- data/spec/fixtures/repository.json +0 -34
- data/spec/fixtures/repository_issues_comments.json +0 -52
- data/spec/fixtures/repository_network_events.json +0 -155
- data/spec/fixtures/repository_notifications.json +0 -32
- data/spec/fixtures/say.txt +0 -22
- data/spec/fixtures/say_custom.txt +0 -22
- data/spec/fixtures/stargazers.json +0 -212
- data/spec/fixtures/starred.json +0 -1114
- data/spec/fixtures/starred_gists.json +0 -30
- data/spec/fixtures/status.json +0 -16
- data/spec/fixtures/statuses.json +0 -34
- data/spec/fixtures/subscribers.json +0 -9
- data/spec/fixtures/subscription.json +0 -8
- data/spec/fixtures/subscription_update.json +0 -8
- data/spec/fixtures/subscriptions.json +0 -39
- data/spec/fixtures/tag.json +0 -16
- data/spec/fixtures/tag_create.json +0 -16
- data/spec/fixtures/tags.json +0 -173
- data/spec/fixtures/team.json +0 -8
- data/spec/fixtures/teams.json +0 -12
- data/spec/fixtures/thread_subscription.json +0 -8
- data/spec/fixtures/thread_subscription_update.json +0 -8
- data/spec/fixtures/tree.json +0 -112
- data/spec/fixtures/tree_create.json +0 -14
- data/spec/fixtures/update_content.json +0 -44
- data/spec/fixtures/user_events.json +0 -101
- data/spec/fixtures/user_issues.json +0 -710
- data/spec/fixtures/user_performed_public_events.json +0 -78
- data/spec/fixtures/user_public_events.json +0 -78
- data/spec/fixtures/validation_failed.json +0 -11
- data/spec/fixtures/watched.json +0 -1022
- data/spec/fixtures/watchers.json +0 -182
- data/spec/octokit/client/github_spec.rb +0 -19
- data/spec/octokit/client/issue_events_spec.rb +0 -30
- data/spec/octokit/client/pub_sub_hubbub/service_hooks_spec.rb +0 -48
- data/spec/octokit/client/pulls_spec.rb +0 -210
@@ -1,178 +1,184 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
require 'helper'
|
3
2
|
|
4
3
|
describe Octokit::Client::Gists do
|
5
4
|
|
6
5
|
before do
|
7
|
-
|
8
|
-
@client = Octokit::Client.new(:login => @username)
|
6
|
+
Octokit.reset!
|
9
7
|
end
|
10
8
|
|
11
|
-
describe "
|
12
|
-
it "returns public gists" do
|
13
|
-
stub_get("/gists/public").to_return(json_response("public_gists.json"))
|
14
|
-
gists = @client.public_gists
|
15
|
-
expect(gists).not_to be_empty
|
16
|
-
end
|
17
|
-
end # .public_gists
|
9
|
+
describe "unauthenticated", :vcr do
|
18
10
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
11
|
+
describe ".public_gists" do
|
12
|
+
it "returns public gists" do
|
13
|
+
gists = Octokit.client.public_gists
|
14
|
+
expect(gists).to_not be_empty
|
15
|
+
assert_requested :get, github_url('/gists/public')
|
16
|
+
end
|
17
|
+
end # .public_gists
|
18
|
+
|
19
|
+
describe ".gists" do
|
20
|
+
describe "with username passed" do
|
21
|
+
it "returns a list of gists" do
|
22
|
+
gists = Octokit.client.gists('defunkt')
|
23
|
+
expect(gists).to_not be_empty
|
24
|
+
assert_requested :get, github_url("/users/defunkt/gists")
|
25
|
+
end
|
26
26
|
end
|
27
|
-
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
describe "without a username passed" do
|
29
|
+
it "returns a list of gists" do
|
30
|
+
gists = Octokit.client.gists
|
31
|
+
expect(gists).to_not be_empty
|
32
|
+
assert_requested :get, github_url("/gists")
|
33
|
+
end
|
34
34
|
end
|
35
|
-
end
|
36
|
-
end # .gists
|
37
35
|
|
38
|
-
|
39
|
-
it "returns the user's starred gists" do
|
40
|
-
stub_get("/gists/starred").to_return(json_response("starred_gists.json"))
|
41
|
-
gists = @client.starred_gists
|
42
|
-
expect(gists).not_to be_empty
|
43
|
-
end
|
44
|
-
end
|
36
|
+
end # .gists
|
45
37
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
38
|
+
describe ".gist" do
|
39
|
+
it "returns the gist by ID" do
|
40
|
+
gist = Octokit.client.gist(790381)
|
41
|
+
expect(gist.user.login).to eq 'jmccartie'
|
42
|
+
assert_requested :get, github_url("/gists/790381")
|
43
|
+
end
|
51
44
|
end
|
52
|
-
end
|
53
45
|
|
54
|
-
|
55
|
-
|
56
|
-
|
46
|
+
end # unauthenticated
|
47
|
+
|
48
|
+
describe "when authenticated", :vcr do
|
49
|
+
|
50
|
+
before do
|
51
|
+
@client = oauth_client
|
57
52
|
new_gist = {
|
58
|
-
:description =>
|
59
|
-
:public =>
|
60
|
-
:files =>
|
53
|
+
:description => "A gist from Octokit",
|
54
|
+
:public => true,
|
55
|
+
:files => {
|
56
|
+
"zen.text" => { :content => "Keep it logically awesome." }
|
57
|
+
}
|
61
58
|
}
|
62
59
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
gist = @client.create_gist(new_gist)
|
67
|
-
expect(gist).to eq(gist_content)
|
60
|
+
@gist = @client.create_gist(new_gist)
|
61
|
+
@gist_comment = @client.create_gist_comment(5421307, ":metal:")
|
68
62
|
end
|
69
|
-
end
|
70
63
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
64
|
+
describe ".gists" do
|
65
|
+
it "returns a list of gists" do
|
66
|
+
gists = @client.gists
|
67
|
+
expect(gists).to_not be_empty
|
68
|
+
assert_requested :get, github_url("/gists")
|
69
|
+
end
|
70
|
+
end # .gists
|
76
71
|
|
77
|
-
stub_patch("/gists/#{gist_id}").
|
78
|
-
to_return(:body => updated_gist)
|
79
72
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
73
|
+
describe ".starred_gists" do
|
74
|
+
it "returns the user's starred gists" do
|
75
|
+
gists = @client.starred_gists
|
76
|
+
expect(gists).to be_kind_of Array
|
77
|
+
assert_requested :get, github_url("/gists/starred")
|
78
|
+
end
|
79
|
+
end # .starred_gists
|
84
80
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
81
|
+
describe ".create_gist" do
|
82
|
+
it "creates a new gist" do
|
83
|
+
expect(@gist.user.login).to eq 'api-padawan'
|
84
|
+
expect(@gist.files.fields.first.to_s).to match /zen/
|
85
|
+
assert_requested :post, github_url("/gists")
|
86
|
+
end
|
87
|
+
end # .create_gist
|
92
88
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
end
|
99
|
-
end
|
89
|
+
describe ".edit_gist" do
|
90
|
+
it "edit an existing gist" do
|
91
|
+
gist = @client.edit_gist(@gist.id, :description => "GitHub Zen")
|
92
|
+
assert_requested :patch, github_url("/gists/#{@gist.id}")
|
93
|
+
end
|
94
|
+
end # .edit_gist
|
100
95
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
96
|
+
describe ".star_gist" do
|
97
|
+
it "stars an existing gist" do
|
98
|
+
@client.star_gist(@gist.id)
|
99
|
+
assert_requested :put, github_url("/gists/#{@gist.id}/star")
|
100
|
+
expect(@client.last_response.status).to eq 204
|
101
|
+
end
|
102
|
+
end # .star
|
107
103
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
104
|
+
describe ".unstar_gist" do
|
105
|
+
it "unstars an existing gist" do
|
106
|
+
@client.unstar_gist(@gist.id)
|
107
|
+
assert_requested :delete, github_url("/gists/#{@gist.id}/star")
|
108
|
+
expect(@client.last_response.status).to eq 204
|
109
|
+
end
|
110
|
+
end # .unstar_gist
|
114
111
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
112
|
+
describe ".gist_starred?" do
|
113
|
+
it "is starred" do
|
114
|
+
starred = @client.gist_starred?(5421307)
|
115
|
+
assert_requested :get, github_url("/gists/5421307/star")
|
116
|
+
expect(starred).to eq true
|
117
|
+
end
|
119
118
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
119
|
+
it "is not starred" do
|
120
|
+
starred = @client.gist_starred?(5421308)
|
121
|
+
assert_requested :get, github_url("/gists/5421308/star")
|
122
|
+
expect(starred).to eq false
|
123
|
+
end
|
124
|
+
end # .gist_starred?
|
124
125
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
end
|
126
|
+
describe ".fork_gist" do
|
127
|
+
it "forks an existing gist" do
|
128
|
+
latest = Octokit.gist(5506606)
|
129
|
+
gist = @client.fork_gist(latest.id)
|
130
|
+
expect(gist.description).to eq latest.description
|
131
|
+
assert_requested :post, github_url("/gists/#{latest.id}/forks")
|
132
132
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
comments = @client.gist_comments(12345)
|
138
|
-
expect(comments.first.id).to eq(451398)
|
139
|
-
end
|
140
|
-
end
|
133
|
+
# cleanup so we can re-run later
|
134
|
+
@client.delete_gist(gist.id)
|
135
|
+
end
|
136
|
+
end # .fork_gist
|
141
137
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
end
|
149
|
-
end
|
138
|
+
describe ".gist_comments" do
|
139
|
+
it "returns the list of gist comments" do
|
140
|
+
comments = @client.gist_comments(5421307)
|
141
|
+
expect(comments).to be_kind_of Array
|
142
|
+
assert_requested :get, github_url("/gists/5421307/comments")
|
143
|
+
end
|
144
|
+
end # .gist_comments
|
150
145
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
end
|
159
|
-
end
|
146
|
+
describe ".gist_comment" do
|
147
|
+
it "returns a gist comment" do
|
148
|
+
comment = @client.gist_comment("5421307", 818334)
|
149
|
+
expect(comment.body).to match "sparkles"
|
150
|
+
assert_requested :get, github_url("/gists/5421307/comments/818334")
|
151
|
+
end
|
152
|
+
end # .gist_comment
|
160
153
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
expect(comment.body).to eq(":heart:")
|
167
|
-
end
|
168
|
-
end
|
154
|
+
describe ".create_gist_comment" do
|
155
|
+
it "creates a gist comment" do
|
156
|
+
assert_requested :post, github_url("/gists/5421307/comments")
|
157
|
+
end
|
158
|
+
end # .create_gist_comment
|
169
159
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
end
|
176
|
-
|
160
|
+
describe ".update_gist_comment" do
|
161
|
+
it "updates a gist comment" do
|
162
|
+
update = @client.update_gist_comment(5421307, @gist_comment.id, ":heart:")
|
163
|
+
assert_requested :patch, github_url("/gists/5421307/comments/#{@gist_comment.id}")
|
164
|
+
end
|
165
|
+
end # .update_gist_comment
|
166
|
+
|
167
|
+
describe ".delete_gist_comment" do
|
168
|
+
it "deletes a gist comment" do
|
169
|
+
comment = @client.create_gist_comment(5421307, ":metal:")
|
170
|
+
@client.delete_gist_comment(5421307, @gist_comment.id)
|
171
|
+
assert_requested :delete, github_url("/gists/5421307/comments/#{@gist_comment.id}")
|
172
|
+
end
|
173
|
+
end # .delete_gist_comment
|
174
|
+
|
175
|
+
describe ".delete_gist" do
|
176
|
+
it "deletes an existing gist" do
|
177
|
+
@client.delete_gist(@gist.id)
|
178
|
+
assert_requested :delete, github_url("/gists/#{@gist.id}")
|
179
|
+
end
|
180
|
+
end # .delete_gist
|
181
|
+
|
182
|
+
end # authenticated
|
177
183
|
|
178
184
|
end
|
@@ -1,29 +1,26 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
require 'helper'
|
3
2
|
|
4
3
|
describe Octokit::Client::Gitignore do
|
5
|
-
|
4
|
+
|
6
5
|
before do
|
7
|
-
@client =
|
6
|
+
@client = oauth_client
|
8
7
|
end
|
9
8
|
|
10
|
-
describe ".gitignore_templates" do
|
9
|
+
describe ".gitignore_templates", :vcr do
|
11
10
|
it "returns all gitignore templates" do
|
12
|
-
stub_get("/gitignore/templates").
|
13
|
-
to_return(json_response("gitignore_templates.json"))
|
14
11
|
templates = @client.gitignore_templates
|
15
|
-
expect(templates
|
12
|
+
expect(templates).to be_kind_of Array
|
13
|
+
assert_requested :get, github_url("/gitignore/templates")
|
16
14
|
end
|
17
|
-
end
|
15
|
+
end # .gitignore_templates
|
18
16
|
|
19
|
-
describe ".gitignore_template" do
|
17
|
+
describe ".gitignore_template", :vcr do
|
20
18
|
it "returns the ruby gitignore template" do
|
21
|
-
stub_get("/gitignore/templates/Ruby").
|
22
|
-
to_return(json_response("gitignore_template_ruby.json"))
|
23
19
|
template = @client.gitignore_template("Ruby")
|
24
|
-
expect(template.name).to eq
|
25
|
-
expect(template.source).to include
|
20
|
+
expect(template.name).to eq "Ruby"
|
21
|
+
expect(template.source).to include "*.gem\n"
|
22
|
+
assert_requested :get, github_url("/gitignore/templates/Ruby")
|
26
23
|
end
|
27
|
-
end
|
24
|
+
end # .gitignore_template
|
28
25
|
|
29
26
|
end
|
@@ -1,206 +1,174 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
require 'helper'
|
3
2
|
|
4
3
|
describe Octokit::Client::Issues do
|
5
4
|
|
6
5
|
before do
|
7
|
-
|
6
|
+
Octokit.reset!
|
7
|
+
@client = oauth_client
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
it "returns matching issues" do
|
13
|
-
stub_get("https://api.github.com/legacy/issues/search/sferik/rails_admin/open/activerecord").
|
14
|
-
to_return(json_response("legacy/issues.json"))
|
15
|
-
issues = @client.search_issues("sferik/rails_admin", "activerecord")
|
16
|
-
expect(issues.first.number).to eq(105)
|
17
|
-
end
|
18
|
-
|
10
|
+
after do
|
11
|
+
Octokit.reset!
|
19
12
|
end
|
20
13
|
|
21
|
-
describe ".list_issues" do
|
22
|
-
|
14
|
+
describe ".list_issues", :vcr do
|
23
15
|
it "returns issues for a repository" do
|
24
|
-
stub_get("/repos/sferik/rails_admin/issues").
|
25
|
-
to_return(json_response("issues.json"))
|
26
16
|
issues = @client.issues("sferik/rails_admin")
|
27
|
-
expect(issues
|
17
|
+
expect(issues).to be_kind_of Array
|
18
|
+
assert_requested :get, github_url("/repos/sferik/rails_admin/issues")
|
28
19
|
end
|
29
|
-
|
30
|
-
it "returns issues for the authenticated user" do
|
31
|
-
stub_get("/issues").
|
32
|
-
to_return(json_response("issues.json"))
|
20
|
+
it "returns dashboard issues for the authenticated user" do
|
33
21
|
issues = @client.issues
|
34
|
-
expect(issues
|
22
|
+
expect(issues).to be_kind_of Array
|
23
|
+
assert_requested :get, github_url("/issues")
|
35
24
|
end
|
25
|
+
end # .list_issues
|
36
26
|
|
37
|
-
|
38
|
-
|
39
|
-
describe ".user_issues" do
|
40
|
-
|
41
|
-
it "returns issues for the authenticated user" do
|
42
|
-
stub_get("/user/issues").
|
43
|
-
to_return(json_response("user_issues.json"))
|
27
|
+
describe ".user_issues", :vcr do
|
28
|
+
it "returns issues for the authenticated user for owned and member repos" do
|
44
29
|
issues = @client.user_issues
|
45
|
-
expect(issues
|
30
|
+
expect(issues).to be_kind_of Array
|
31
|
+
assert_requested :get, github_url("/user/issues")
|
46
32
|
end
|
33
|
+
end # .user_issues
|
47
34
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
stub_get("/orgs/github/issues").
|
54
|
-
to_return(json_response("org_issues.json"))
|
55
|
-
issues = @client.org_issues('github')
|
56
|
-
expect(issues.first.number).to eq(43)
|
35
|
+
describe ".org_issues", :vcr do
|
36
|
+
it "returns issues for the organization for the authenticated user" do
|
37
|
+
issues = @client.org_issues('dotfiles')
|
38
|
+
expect(issues).to be_kind_of Array
|
39
|
+
assert_requested :get, github_url("/orgs/dotfiles/issues")
|
57
40
|
end
|
41
|
+
end # .org_issues
|
58
42
|
|
59
|
-
|
60
|
-
|
61
|
-
describe ".create_issue" do
|
62
|
-
|
43
|
+
describe ".create_issue", :vcr, :match_requests_on => [:path, :body] do
|
63
44
|
it "creates an issue" do
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
issue
|
69
|
-
|
70
|
-
end
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
45
|
+
issue = @client.create_issue \
|
46
|
+
"api-playground/api-sandbox",
|
47
|
+
"Migrate issues to v3",
|
48
|
+
"Move all Issues calls to v3 of the API"
|
49
|
+
expect(issue.title).to match /Migrate/
|
50
|
+
assert_requested :post, github_url("/repos/api-playground/api-sandbox/issues")
|
51
|
+
end
|
52
|
+
it "creates an issue with delimited labels" do
|
53
|
+
issue = @client.create_issue \
|
54
|
+
"api-playground/api-sandbox",
|
55
|
+
"New issue with delimited labels",
|
56
|
+
"Testing",
|
57
|
+
:labels => "bug, feature"
|
58
|
+
expect(issue.title).to match /delimited/
|
59
|
+
expect(issue.labels.map(&:name)).to include("feature")
|
60
|
+
assert_requested :post, github_url("/repos/api-playground/api-sandbox/issues")
|
61
|
+
end
|
62
|
+
it "creates an issue with labels array" do
|
63
|
+
issue = @client.create_issue \
|
64
|
+
"api-playground/api-sandbox",
|
65
|
+
"New issue with labels array",
|
66
|
+
"Testing",
|
67
|
+
:labels => %w(bug feature)
|
68
|
+
expect(issue.title).to match /array/
|
69
|
+
expect(issue.labels.map(&:name)).to include("feature")
|
70
|
+
assert_requested :post, github_url("/repos/api-playground/api-sandbox/issues")
|
71
|
+
end
|
72
|
+
end # .create_issue
|
73
|
+
|
74
|
+
context "methods requiring a new issue", :vcr do
|
75
|
+
|
76
|
+
before do
|
77
|
+
@issue = @client.create_issue("api-playground/api-sandbox", "Migrate issues to v3", "Move all Issues calls to v3 of the API")
|
78
|
+
end
|
79
|
+
|
80
|
+
describe ".issue" do
|
85
81
|
it "returns an issue" do
|
86
|
-
|
87
|
-
|
88
|
-
issue
|
89
|
-
expect(issue.body_html).to include('<p>Create, Edit, Delete missing')
|
90
|
-
expect(issue.body_text).to include('Create, Edit, Delete missing')
|
82
|
+
issue = @client.issue("api-playground/api-sandbox", @issue.number)
|
83
|
+
assert_requested :get, github_url("/repos/api-playground/api-sandbox/issues/#{@issue.number}")
|
84
|
+
expect(issue.number).to eq @issue.number
|
91
85
|
end
|
92
|
-
|
86
|
+
it "returns a full issue" do
|
87
|
+
issue = @client.issue("api-playground/api-sandbox", @issue.number, :accept => 'application/vnd.github.full+json')
|
88
|
+
assert_requested :get, github_url("/repos/api-playground/api-sandbox/issues/#{@issue.number}")
|
89
|
+
expect(issue.body_html).to include '<p>Move all'
|
90
|
+
expect(issue.body_text).to include 'Move all'
|
91
|
+
end
|
92
|
+
end # .issue
|
93
93
|
|
94
|
-
|
94
|
+
describe ".close_issue" do
|
95
|
+
it "closes an issue" do
|
96
|
+
issue = @client.close_issue("api-playground/api-sandbox", @issue.number)
|
97
|
+
expect(issue.number).to eq @issue.number
|
98
|
+
assert_requested :patch, github_url("/repos/api-playground/api-sandbox/issues/#{@issue.number}")
|
99
|
+
end
|
100
|
+
end # .close_issue
|
95
101
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
issue = @client.close_issue("ctshryock/octokit", 12)
|
104
|
-
expect(issue.number).to eq(12)
|
105
|
-
expect(issue).to include :closed_at
|
106
|
-
expect(issue.state).to eq("closed")
|
107
|
-
end
|
102
|
+
describe ".reopen_issue" do
|
103
|
+
it "reopens an issue" do
|
104
|
+
issue = @client.close_issue("api-playground/api-sandbox", @issue.number)
|
105
|
+
expect(issue.number).to eq @issue.number
|
106
|
+
assert_requested :patch, github_url("/repos/api-playground/api-sandbox/issues/#{@issue.number}")
|
107
|
+
end
|
108
|
+
end # .reopen_issue
|
108
109
|
|
109
|
-
|
110
|
+
describe ".update_issue" do
|
111
|
+
it "updates an issue" do
|
112
|
+
issue = @client.update_issue("api-playground/api-sandbox", @issue.number, "Use all the v3 api!", "")
|
113
|
+
expect(issue.number).to eq @issue.number
|
114
|
+
assert_requested :patch, github_url("/repos/api-playground/api-sandbox/issues/#{@issue.number}")
|
115
|
+
end
|
116
|
+
end # .update_issue
|
110
117
|
|
111
|
-
|
118
|
+
describe ".add_comment" do
|
119
|
+
it "adds a comment" do
|
120
|
+
comment = @client.add_comment("api-playground/api-sandbox", @issue.number, "A test comment")
|
121
|
+
expect(comment.user.login).to eq test_github_login
|
122
|
+
assert_requested :post, github_url("/repos/api-playground/api-sandbox/issues/#{@issue.number}/comments")
|
123
|
+
end
|
124
|
+
end # .add_comment
|
112
125
|
|
113
|
-
|
114
|
-
stub_patch("/repos/ctshryock/octokit/issues/12").
|
115
|
-
with(:body => {"state" => "open"},
|
116
|
-
:headers => {'Content-Type'=>'application/json'}).
|
117
|
-
to_return(json_response("issue.json"))
|
118
|
-
issue = @client.reopen_issue("ctshryock/octokit", 12)
|
119
|
-
expect(issue.number).to eq(12)
|
120
|
-
expect(issue.state).to eq("open")
|
121
|
-
end
|
126
|
+
context "methods requiring a new issue comment" do
|
122
127
|
|
123
|
-
|
128
|
+
before do
|
129
|
+
@issue_comment = @client.add_comment("api-playground/api-sandbox", @issue.number, "Another test comment")
|
130
|
+
end
|
124
131
|
|
125
|
-
|
132
|
+
describe ".update_comment" do
|
133
|
+
it "updates an existing comment" do
|
134
|
+
@client.update_comment("api-playground/api-sandbox", @issue_comment.id, "A test comment update")
|
135
|
+
assert_requested :patch, github_url("/repos/api-playground/api-sandbox/issues/comments/#{@issue_comment.id}")
|
136
|
+
end
|
137
|
+
end # .update_comment
|
138
|
+
|
139
|
+
describe ".delete_comment" do
|
140
|
+
it "deletes an existing comment" do
|
141
|
+
@client.delete_comment("api-playground/api-sandbox", @issue_comment.id)
|
142
|
+
assert_requested :delete, github_url("/repos/api-playground/api-sandbox/issues/comments/#{@issue_comment.id}")
|
143
|
+
end # .delete_comment
|
144
|
+
end
|
126
145
|
|
127
|
-
it "updates an issue" do
|
128
|
-
stub_patch("/repos/ctshryock/octokit/issues/12").
|
129
|
-
with(:body => {"title" => "Use all the v3 api!", "body" => ""},
|
130
|
-
:headers => {'Content-Type'=>'application/json'}).
|
131
|
-
to_return(json_response("issue.json"))
|
132
|
-
issue = @client.update_issue("ctshryock/octokit", 12, "Use all the v3 api!", "")
|
133
|
-
expect(issue.number).to eq(12)
|
134
146
|
end
|
135
147
|
|
136
148
|
end
|
137
149
|
|
138
|
-
describe ".repository_issues_comments" do
|
139
|
-
|
150
|
+
describe ".repository_issues_comments", :vcr do
|
140
151
|
it "returns comments for all issues in a repository" do
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
expect(comments.first.user.login).to eq("pengwynn")
|
152
|
+
comments = @client.issues_comments("octokit/octokit.rb")
|
153
|
+
expect(comments).to be_kind_of Array
|
154
|
+
assert_requested :get, github_url('/repos/octokit/octokit.rb/issues/comments')
|
145
155
|
end
|
156
|
+
end # .repository_issues_comments
|
146
157
|
|
147
|
-
|
148
|
-
|
149
|
-
describe ".issue_comments" do
|
150
|
-
|
158
|
+
describe ".issue_comments", :vcr do
|
151
159
|
it "returns comments for an issue" do
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
expect(comments.first.user.login).to eq("ctshryock")
|
160
|
+
comments = @client.issue_comments("octokit/octokit.rb", 25)
|
161
|
+
expect(comments).to be_kind_of Array
|
162
|
+
assert_requested :get, github_url('/repos/octokit/octokit.rb/issues/25/comments')
|
156
163
|
end
|
164
|
+
end # .issue_comments
|
157
165
|
|
158
|
-
|
159
|
-
|
160
|
-
describe ".issue_comment" do
|
161
|
-
|
166
|
+
describe ".issue_comment", :vcr do
|
162
167
|
it "returns a single comment for an issue" do
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
expect(comments.user.login).to eq("ctshryock")
|
167
|
-
expect(comments.url).to eq("https://api.github.com/repos/pengwynn/octokit/issues/comments/1194690")
|
168
|
+
comment = @client.issue_comment("octokit/octokit.rb", 1194690)
|
169
|
+
expect(comment.rels[:self].href).to eq "https://api.github.com/repos/octokit/octokit.rb/issues/comments/1194690"
|
170
|
+
assert_requested :get, github_url('/repos/octokit/octokit.rb/issues/comments/1194690')
|
168
171
|
end
|
172
|
+
end # .issue_comment
|
169
173
|
|
170
|
-
end
|
171
|
-
|
172
|
-
describe ".add_comment" do
|
173
|
-
|
174
|
-
it "adds a comment" do
|
175
|
-
stub_post("/repos/pengwynn/octokit/issues/25/comments").
|
176
|
-
with(:body => {"body" => "A test comment"}).
|
177
|
-
to_return(json_response('comment.json'))
|
178
|
-
comment = @client.add_comment("pengwynn/octokit", 25, "A test comment")
|
179
|
-
expect(comment.user.login).to eq("ctshryock")
|
180
|
-
end
|
181
|
-
|
182
|
-
end
|
183
|
-
|
184
|
-
describe ".update_comment" do
|
185
|
-
|
186
|
-
it "updates an existing comment" do
|
187
|
-
stub_patch("/repos/pengwynn/octokit/issues/comments/1194549").
|
188
|
-
with(:body => {"body" => "A test comment update"}).
|
189
|
-
to_return(json_response('comment.json'))
|
190
|
-
comment = @client.update_comment("pengwynn/octokit", 1194549, "A test comment update")
|
191
|
-
expect(comment.user.login).to eq("ctshryock")
|
192
|
-
end
|
193
|
-
|
194
|
-
end
|
195
|
-
|
196
|
-
describe ".delete_comment" do
|
197
|
-
|
198
|
-
it "deletes an existing comment" do
|
199
|
-
stub_delete("/repos/pengwynn/octokit/issues/comments/1194549").
|
200
|
-
to_return(:status => 204)
|
201
|
-
result = @client.delete_comment("pengwynn/octokit", 1194549)
|
202
|
-
expect(result).to eq(true)
|
203
|
-
end
|
204
|
-
|
205
|
-
end
|
206
174
|
end
|