bugsnag-api 1.0.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +14 -3
- data/CHANGELOG.md +32 -0
- data/CONTRIBUTING.md +40 -0
- data/README.md +126 -111
- data/bugsnag-api.gemspec +4 -3
- data/lib/bugsnag/api/client.rb +18 -9
- data/lib/bugsnag/api/client/collaborators.rb +87 -0
- data/lib/bugsnag/api/client/comments.rb +31 -40
- data/lib/bugsnag/api/client/currentuser.rb +33 -0
- data/lib/bugsnag/api/client/errors.rb +45 -51
- data/lib/bugsnag/api/client/eventfields.rb +50 -0
- data/lib/bugsnag/api/client/events.rb +38 -32
- data/lib/bugsnag/api/client/organizations.rb +46 -0
- data/lib/bugsnag/api/client/pivots.rb +43 -0
- data/lib/bugsnag/api/client/projects.rb +37 -63
- data/lib/bugsnag/api/client/trends.rb +38 -0
- data/lib/bugsnag/api/error.rb +4 -0
- data/lib/bugsnag/api/version.rb +1 -1
- data/spec/bugsnag/api/client/collaborators_spec.rb +101 -0
- data/spec/bugsnag/api/client/comments_spec.rb +42 -30
- data/spec/bugsnag/api/client/currentuser_spec.rb +57 -0
- data/spec/bugsnag/api/client/errors_spec.rb +44 -41
- data/spec/bugsnag/api/client/eventfields_spec.rb +56 -0
- data/spec/bugsnag/api/client/events_spec.rb +41 -29
- data/spec/bugsnag/api/client/organizations_spec.rb +53 -0
- data/spec/bugsnag/api/client/pivots_spec.rb +49 -0
- data/spec/bugsnag/api/client/projects_spec.rb +35 -59
- data/spec/bugsnag/api/client/trends_spec.rb +44 -0
- data/spec/bugsnag/api/client_spec.rb +8 -3
- data/spec/cassettes/Bugsnag_Api_Client/_get/handles_query_params.yml +45 -27
- data/spec/cassettes/Bugsnag_Api_Client/_last_response/caches_the_last_agent_response.yml +45 -27
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/_invitecollaborator/creates_and_returns_a_collaborator.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/_invitecollaborator/invites_multiple_collaborators.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborator/returns_a_collaborator.yml +157 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborators/returns_a_list_of_all_organization_collaborators.yml +160 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborators/returns_a_list_of_all_project_collaborators.yml +160 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_collaborators/throws_an_argument_error_if_neither_org_id_or_project_id_are_provided.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_delete_collaborator/deletes_a_collaborator.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_update_collaborator_permissions/updates_and_returns_the_collaborator.yml +157 -0
- data/spec/cassettes/Bugsnag_Api_Client_Collaborators/given_a_collaborator_exists/_view_collaborator_projects/returns_a_list_of_projects_belonging_to_the_collaborator.yml +159 -0
- data/spec/cassettes/Bugsnag_Api_Client_Comments/_create_comment/creates_a_comment_on_the_error.yml +82 -0
- data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_comment/retrieves_the_comment_specified.yml +159 -0
- data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_comments/retrieves_all_comments_on_an_error.yml +161 -0
- data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_delete_comment/deletes_the_comment_and_returns_true.yml +82 -0
- data/spec/cassettes/Bugsnag_Api_Client_Comments/given_a_comment_has_been_created/_update_comment/updates_the_message_on_a_comment.yml +159 -0
- data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_organizations/when_using_auth_token/returns_the_organization_the_auth_token_belongs_to.yml +81 -0
- data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_organizations/when_using_user_credentials/returns_users_organizations.yml +85 -0
- data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_projects/when_using_auth_token/lists_current_user_s_projects_in_the_organization.yml +82 -0
- data/spec/cassettes/Bugsnag_Api_Client_CurrentUser/_list_projects/when_using_user_credentials/lists_current_user_s_projects_in_the_organization.yml +86 -0
- data/spec/cassettes/Bugsnag_Api_Client_Errors/_error/returns_a_single_error.yml +82 -0
- data/spec/cassettes/Bugsnag_Api_Client_Errors/_errors/returns_errors_on_the_project.yml +84 -0
- data/spec/cassettes/Bugsnag_Api_Client_Errors/_update_errors/updates_and_returns_the_updated_errors.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Events/_error_events/lists_all_error_events.yml +84 -0
- data/spec/cassettes/Bugsnag_Api_Client_Events/_event/returns_the_specified_event.yml +253 -0
- data/spec/cassettes/Bugsnag_Api_Client_Events/_events/returns_the_a_list_of_project_errors.yml +84 -0
- data/spec/cassettes/Bugsnag_Api_Client_Events/_latest_event/returns_the_last_event_on_an_error.yml +253 -0
- data/spec/cassettes/Bugsnag_Api_Client_Organizations/_create_organization/creates_a_new_organization.yml +84 -0
- data/spec/cassettes/Bugsnag_Api_Client_Organizations/with_organization/_delete_organization/deletes_the_organization.yml +159 -0
- data/spec/cassettes/Bugsnag_Api_Client_Organizations/with_organization/_organization/returns_the_requested_organization.yml +165 -0
- data/spec/cassettes/Bugsnag_Api_Client_Organizations/with_organization/_update_organization/updates_and_returns_the_organization.yml +165 -0
- data/spec/cassettes/Bugsnag_Api_Client_Projects/_create_project/creates_a_new_project.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_delete_project/deletes_the_project.yml +151 -0
- data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_project/returns_the_requested_project.yml +157 -0
- data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_regenerate_api_key/removes_the_current_api_key_and_replaces_it_with_a_new_api_key.yml +157 -0
- data/spec/cassettes/Bugsnag_Api_Client_Projects/given_a_project/_update_project/updates_and_returns_the_project.yml +157 -0
- data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_buckets/returns_a_list_of_error_trends_in_bucket_form.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_buckets/returns_a_list_of_project_trends_in_bucket_form.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_resolution/returns_a_list_of_project_trends_in_resolution_form.yml +80 -0
- data/spec/cassettes/Bugsnag_Api_Client_Trends/_trends_resolution/returns_a_list_of_trends_in_resolution_form.yml +80 -0
- data/spec/spec_helper.rb +29 -27
- metadata +124 -83
- data/lib/bugsnag/api/client/accounts.rb +0 -44
- data/lib/bugsnag/api/client/users.rb +0 -99
- data/spec/bugsnag/api/client/accounts_spec.rb +0 -45
- data/spec/bugsnag/api/client/users_spec.rb +0 -105
- data/spec/cassettes/Bugsnag_Api_Client_Accounts/_account/returns_the_requested_account.yml +0 -49
- data/spec/cassettes/Bugsnag_Api_Client_Accounts/_account/when_using_account_credentials/returns_the_account.yml +0 -51
- data/spec/cassettes/Bugsnag_Api_Client_Accounts/_accounts/returns_all_accounts.yml +0 -49
- data/spec/cassettes/Bugsnag_Api_Client_Comments/_comments/returns_all_comments_on_an_error.yml +0 -107
- data/spec/cassettes/Bugsnag_Api_Client_Comments/_create_comment/created_a_comment.yml +0 -51
- data/spec/cassettes/Bugsnag_Api_Client_Comments/with_comment/_comment/returns_a_comment.yml +0 -97
- data/spec/cassettes/Bugsnag_Api_Client_Comments/with_comment/_delete_comment/deletes_an_existing_comment.yml +0 -92
- data/spec/cassettes/Bugsnag_Api_Client_Comments/with_comment/_update_comment/updates_an_existing_comment.yml +0 -97
- data/spec/cassettes/Bugsnag_Api_Client_Errors/_errors/returns_all_errors_on_an_project.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Errors/with_error/_error/returns_an_error.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Errors/with_error/_reopen_error/reopens_the_error.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Errors/with_error/_resolve_error/resolves_the_error.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Errors/with_error/_update_error/updates_the_error.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Events/_error_events/returns_all_events_on_an_error.yml +0 -64
- data/spec/cassettes/Bugsnag_Api_Client_Events/_project_events/returns_all_events_on_a_project.yml +0 -64
- data/spec/cassettes/Bugsnag_Api_Client_Events/with_event/_event/returns_an_event.yml +0 -56
- data/spec/cassettes/Bugsnag_Api_Client_Projects/_account_projects/returns_all_projects_on_an_account.yml +0 -61
- data/spec/cassettes/Bugsnag_Api_Client_Projects/_account_projects/when_using_account_credentials/returns_all_projects.yml +0 -63
- data/spec/cassettes/Bugsnag_Api_Client_Projects/_create_project/creates_a_project_on_an_account.yml +0 -50
- data/spec/cassettes/Bugsnag_Api_Client_Projects/_user_projects/returns_all_projects_for_a_user.yml +0 -61
- data/spec/cassettes/Bugsnag_Api_Client_Projects/with_project/_delete_project/deletes_an_existing_project.yml +0 -91
- data/spec/cassettes/Bugsnag_Api_Client_Projects/with_project/_project/returns_a_project.yml +0 -95
- data/spec/cassettes/Bugsnag_Api_Client_Projects/with_project/_update_project/updates_an_existing_project.yml +0 -95
- data/spec/cassettes/Bugsnag_Api_Client_Users/_account_users/returns_all_users_on_an_account.yml +0 -49
- data/spec/cassettes/Bugsnag_Api_Client_Users/_account_users/when_using_account_credentials/returns_all_users.yml +0 -51
- data/spec/cassettes/Bugsnag_Api_Client_Users/_invite_user/invites_a_user_to_an_account.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Users/_project_users/returns_all_users_for_a_project.yml +0 -49
- data/spec/cassettes/Bugsnag_Api_Client_Users/_user/returns_a_user.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Users/_user/when_using_user_credentials/returns_the_authed_user.yml +0 -48
- data/spec/cassettes/Bugsnag_Api_Client_Users/with_user/_remove_user/removes_a_user_from_an_account.yml +0 -89
- data/spec/cassettes/Bugsnag_Api_Client_Users/with_user/_update_user_permissions/updates_a_users_permissions.yml +0 -93
@@ -0,0 +1,49 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Bugsnag::Api::Client::Pivots do
|
4
|
+
before do
|
5
|
+
skip "event_fields API has issues currently"
|
6
|
+
@client = auth_token_client
|
7
|
+
@project_id = test_bugsnag_project_id
|
8
|
+
@error_id = test_bugsnag_error_id
|
9
|
+
@event_field_id = test_bugsnag_eventfield_id
|
10
|
+
Bugsnag::Api.reset!
|
11
|
+
end
|
12
|
+
|
13
|
+
describe ".pivots", :vcr do
|
14
|
+
it "returns a list of pivots on an error" do
|
15
|
+
pivots = @client.pivots @project_id, @error_id
|
16
|
+
expect(pivots).to be_a_kind_of(Array)
|
17
|
+
expect(pivots.length).to be > 0
|
18
|
+
|
19
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/errors/#{@error_id}/pivots")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns a list of pivots on a project" do
|
23
|
+
pivots = @client.pivots @project_id
|
24
|
+
expect(pivots).to be_a_kind_of(Array)
|
25
|
+
expect(pivots.length).to be > 0
|
26
|
+
|
27
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/pivots")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe ".pivot_values", :vcr do
|
32
|
+
it "returns values of pivots on an error" do
|
33
|
+
values = @client.pivot_values @project_id, @event_field_id, @error_id
|
34
|
+
expect(values).to be_a_kind_of(Array)
|
35
|
+
expect(values.length).to be > 0
|
36
|
+
|
37
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/errors/#{@error_id}/pivots/#{@event_field_id}/values")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "returns values of pivots on a project" do
|
41
|
+
values = @client.pivot_values @project_id, @event_field_id
|
42
|
+
expect(values).to be_a_kind_of(Array)
|
43
|
+
expect(values.length).to be > 0
|
44
|
+
|
45
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/pivots/#{@event_field_id}/values")
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
@@ -2,85 +2,61 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Bugsnag::Api::Client::Projects do
|
4
4
|
before do
|
5
|
+
@client = auth_token_client
|
6
|
+
@org_id = test_bugsnag_org_id
|
5
7
|
Bugsnag::Api.reset!
|
6
|
-
@client = basic_auth_client
|
7
|
-
end
|
8
|
-
|
9
|
-
describe ".account_projects", :vcr do
|
10
|
-
context "when using account credentials" do
|
11
|
-
it "returns all projects" do
|
12
|
-
client = auth_token_client
|
13
|
-
projects = client.account_projects
|
14
|
-
expect(projects).to be_kind_of(Array)
|
15
|
-
expect(projects.first.name).not_to be_nil
|
16
|
-
|
17
|
-
assert_requested :get, bugsnag_url("/account/projects")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
context "when using user credentials" do
|
22
|
-
it "raises an error" do
|
23
|
-
expect { @client.account_projects }.to raise_error Bugsnag::Api::AccountCredentialsRequired
|
24
|
-
|
25
|
-
assert_not_requested :get, basic_bugsnag_url("/account/projects")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
it "returns all projects on an account" do
|
30
|
-
projects = @client.account_projects(test_bugsnag_account)
|
31
|
-
expect(projects).to be_kind_of(Array)
|
32
|
-
expect(projects.first.name).not_to be_nil
|
33
|
-
|
34
|
-
assert_requested :get, basic_bugsnag_url("/accounts/#{test_bugsnag_account}/projects")
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe ".user_projects", :vcr do
|
39
|
-
it "returns all projects for a user" do
|
40
|
-
projects = @client.user_projects(test_bugsnag_user)
|
41
|
-
expect(projects).to be_kind_of(Array)
|
42
|
-
expect(projects.first.name).not_to be_nil
|
43
|
-
|
44
|
-
assert_requested :get, basic_bugsnag_url("/users/#{test_bugsnag_user}/projects")
|
45
|
-
end
|
46
8
|
end
|
47
9
|
|
48
10
|
describe ".create_project", :vcr do
|
49
|
-
it "creates a project
|
50
|
-
|
51
|
-
|
11
|
+
it "creates a new project" do
|
12
|
+
new_project = @client.create_project @org_id, "testProject", "other"
|
13
|
+
expect(new_project.name).to eq("testProject")
|
52
14
|
|
53
|
-
|
15
|
+
assert_requested :post, bugsnag_url("/organizations/#{@org_id}/projects")
|
54
16
|
end
|
55
17
|
end
|
56
18
|
|
57
|
-
context "
|
19
|
+
context "given a project", :vcr do
|
58
20
|
before do
|
59
|
-
@project = @client.create_project
|
21
|
+
@project = @client.create_project @org_id, "testProject", "other"
|
60
22
|
end
|
61
23
|
|
62
|
-
describe ".project" do
|
63
|
-
it "returns
|
64
|
-
project = @client.project
|
24
|
+
describe ".project", :vcr do
|
25
|
+
it "returns the requested project" do
|
26
|
+
project = @client.project @project.id
|
65
27
|
expect(project.id).to eq(@project.id)
|
28
|
+
expect(project.name).to eq("testProject")
|
29
|
+
|
30
|
+
assert_requested :get, bugsnag_url("/projects/#{@project.id}")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe ".update_project", :vcr do
|
35
|
+
it "updates and returns the project" do
|
36
|
+
updated_project = @client.update_project @project.id, {:name => "otherName"}
|
37
|
+
expect(updated_project.id).to eq(@project.id)
|
38
|
+
expect(updated_project.name).to eq("otherName")
|
66
39
|
|
67
|
-
assert_requested :
|
40
|
+
assert_requested :patch, bugsnag_url("/projects/#{@project.id}")
|
68
41
|
end
|
69
42
|
end
|
70
43
|
|
71
|
-
describe ".
|
72
|
-
it "
|
73
|
-
updated_project = @client.
|
44
|
+
describe ".regenerate_api_key", :vcr do
|
45
|
+
it "removes the current api key and replaces it with a new api key" do
|
46
|
+
updated_project = @client.regenerate_api_key @project.id
|
74
47
|
expect(updated_project.id).to eq(@project.id)
|
75
|
-
|
48
|
+
expect(updated_project.api_key).not_to eq(@project.api_key)
|
49
|
+
|
50
|
+
assert_requested :delete, bugsnag_url("/projects/#{@project.id}/api_key")
|
76
51
|
end
|
77
52
|
end
|
53
|
+
|
54
|
+
describe ".delete_project", :vcr do
|
55
|
+
it "deletes the project" do
|
56
|
+
deleted_project = @client.delete_project @project.id
|
57
|
+
expect(deleted_project).to be true
|
78
58
|
|
79
|
-
|
80
|
-
it "deletes an existing project" do
|
81
|
-
response = @client.delete_project(@project.id)
|
82
|
-
expect(response).to be true
|
83
|
-
assert_requested :delete, basic_bugsnag_url("/projects/#{@project.id}")
|
59
|
+
assert_requested :delete, bugsnag_url("/projects/#{@project.id}")
|
84
60
|
end
|
85
61
|
end
|
86
62
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Bugsnag::Api::Client::Trends do
|
4
|
+
before do
|
5
|
+
@project_id = test_bugsnag_project_id
|
6
|
+
@error_id = test_bugsnag_error_id
|
7
|
+
@client = auth_token_client
|
8
|
+
Bugsnag::Api.reset!
|
9
|
+
end
|
10
|
+
|
11
|
+
describe ".trends_buckets", :vcr do
|
12
|
+
it "returns a list of error trends in bucket form" do
|
13
|
+
trends = @client.trends_buckets @project_id, 5, @error_id
|
14
|
+
expect(trends).to be_a_kind_of(Array)
|
15
|
+
expect(trends.length).to eq(5)
|
16
|
+
|
17
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/errors/#{@error_id}/trend?buckets_count=5")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "returns a list of project trends in bucket form" do
|
21
|
+
trends = @client.trends_buckets @project_id, 5
|
22
|
+
expect(trends).to be_a_kind_of(Array)
|
23
|
+
expect(trends.length).to eq(5)
|
24
|
+
|
25
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/trend?buckets_count=5")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe ".trends_resolution", :vcr do
|
30
|
+
it "returns a list of trends in resolution form" do
|
31
|
+
trends = @client.trends_resolution @project_id, "12h", @error_id
|
32
|
+
|
33
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/errors/#{@error_id}/trend?resolution=12h")
|
34
|
+
end
|
35
|
+
|
36
|
+
it "returns a list of project trends in resolution form" do
|
37
|
+
trends = @client.trends_resolution @project_id, "12h"
|
38
|
+
expect(trends).to be_a_kind_of(Array)
|
39
|
+
expect(trends.length).to be > 0
|
40
|
+
|
41
|
+
assert_requested :get, bugsnag_url("/projects/#{@project_id}/trend?resolution=12h")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -44,14 +44,14 @@ describe Bugsnag::Api::Client do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it "handles query params", :vcr do
|
47
|
-
Bugsnag::Api.get "/", :foo => "bar"
|
47
|
+
Bugsnag::Api.get bugsnag_url("/"), :foo => "bar"
|
48
48
|
assert_requested :get, "https://api.bugsnag.com?foo=bar"
|
49
49
|
end
|
50
50
|
|
51
51
|
it "handles headers" do
|
52
52
|
request = stub_get("/zen").
|
53
53
|
with(:query => {:foo => "bar"}, :headers => {:accept => "text/plain"})
|
54
|
-
Bugsnag::Api.get "/zen", :foo => "bar", :accept => "text/plain"
|
54
|
+
Bugsnag::Api.get bugsnag_url("/zen"), :foo => "bar", :accept => "text/plain"
|
55
55
|
assert_requested request
|
56
56
|
end
|
57
57
|
end
|
@@ -62,7 +62,7 @@ describe Bugsnag::Api::Client do
|
|
62
62
|
client = Bugsnag::Api.client
|
63
63
|
expect(client.last_response).to be_nil
|
64
64
|
|
65
|
-
client.get "/"
|
65
|
+
client.get bugsnag_url("/")
|
66
66
|
expect(client.last_response.status).to eq(200)
|
67
67
|
end
|
68
68
|
end
|
@@ -87,6 +87,11 @@ describe Bugsnag::Api::Client do
|
|
87
87
|
expect { Bugsnag::Api.get('/booya') }.to raise_error(Bugsnag::Api::NotFound)
|
88
88
|
end
|
89
89
|
|
90
|
+
it "raises on 429" do
|
91
|
+
stub_get('/test').to_return(:status => 429)
|
92
|
+
expect { Bugsnag::Api.get('/test') }.to raise_error(Bugsnag::Api::RateLimitExceeded)
|
93
|
+
end
|
94
|
+
|
90
95
|
it "raises on 500" do
|
91
96
|
stub_get('/boom').to_return(:status => 500)
|
92
97
|
expect { Bugsnag::Api.get('/boom') }.to raise_error(Bugsnag::Api::InternalServerError)
|
@@ -8,49 +8,67 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Bugsnag API Ruby Gem 1.0.
|
11
|
+
- Bugsnag API Ruby Gem 1.0.3
|
12
12
|
Content-Type:
|
13
13
|
- application/json
|
14
|
+
X-Version:
|
15
|
+
- '2'
|
14
16
|
Accept-Encoding:
|
15
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
18
|
Accept:
|
17
|
-
-
|
19
|
+
- "*/*"
|
18
20
|
response:
|
19
21
|
status:
|
20
22
|
code: 200
|
21
23
|
message: OK
|
22
24
|
headers:
|
23
|
-
|
24
|
-
-
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 09 Oct 2017 14:20:09 GMT
|
25
29
|
Content-Type:
|
26
30
|
- application/json; charset=utf-8
|
27
|
-
|
28
|
-
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
-
|
33
|
-
|
34
|
-
-
|
31
|
+
Etag:
|
32
|
+
- W/"59024f0b45c7aee36c00eaa89f2cce70"
|
33
|
+
Cache-Control:
|
34
|
+
- max-age=0, private, must-revalidate
|
35
|
+
X-Request-Id:
|
36
|
+
- 3bb88017-d992-4f63-8560-e17d1af10910
|
37
|
+
X-Runtime:
|
38
|
+
- '0.006426'
|
39
|
+
Vary:
|
40
|
+
- Origin
|
41
|
+
Content-Security-Policy:
|
42
|
+
- 'default-src ''self''; child-src https://*.stripe.com headway-widget.net;
|
43
|
+
connect-src ''self'' https://api.bugsnag.com https://*.stripe.com https://bugsnag.zendesk.com
|
44
|
+
https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com; img-src
|
45
|
+
''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
|
46
|
+
script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
|
47
|
+
https://maxcdn.bootstrapcdn.com https://code.jquery.com https://assets.zendesk.com
|
48
|
+
https://cdn.headwayapp.co; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com'
|
35
49
|
X-Content-Type-Options:
|
36
50
|
- nosniff
|
51
|
+
X-Download-Options:
|
52
|
+
- noopen
|
37
53
|
X-Frame-Options:
|
38
|
-
-
|
39
|
-
X-
|
40
|
-
-
|
41
|
-
X-Request-Id:
|
42
|
-
- d5805f6d-7f5f-4513-af4d-3a4a259a1707
|
43
|
-
X-Runtime:
|
44
|
-
- '0.004698'
|
54
|
+
- DENY
|
55
|
+
X-Permitted-Cross-Domain-Policies:
|
56
|
+
- none
|
45
57
|
X-Xss-Protection:
|
46
58
|
- 1; mode=block
|
47
|
-
|
48
|
-
-
|
49
|
-
|
50
|
-
-
|
59
|
+
X-Robots-Tag:
|
60
|
+
- noindex, nofollow
|
61
|
+
Strict-Transport-Security:
|
62
|
+
- max-age=31536000
|
63
|
+
Via:
|
64
|
+
- 1.1 google
|
65
|
+
Alt-Svc:
|
66
|
+
- clear
|
67
|
+
Transfer-Encoding:
|
68
|
+
- chunked
|
51
69
|
body:
|
52
|
-
encoding:
|
53
|
-
string: '{"
|
70
|
+
encoding: ASCII-8BIT
|
71
|
+
string: '{"organizations_url":"https://api.bugsnag.com/user/organizations"}'
|
54
72
|
http_version:
|
55
|
-
recorded_at:
|
56
|
-
recorded_with: VCR 2.9.
|
73
|
+
recorded_at: Mon, 09 Oct 2017 14:20:08 GMT
|
74
|
+
recorded_with: VCR 2.9.3
|
@@ -8,49 +8,67 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- Bugsnag API Ruby Gem 1.0.
|
11
|
+
- Bugsnag API Ruby Gem 1.0.3
|
12
12
|
Content-Type:
|
13
13
|
- application/json
|
14
|
+
X-Version:
|
15
|
+
- '2'
|
14
16
|
Accept-Encoding:
|
15
17
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
18
|
Accept:
|
17
|
-
-
|
19
|
+
- "*/*"
|
18
20
|
response:
|
19
21
|
status:
|
20
22
|
code: 200
|
21
23
|
message: OK
|
22
24
|
headers:
|
23
|
-
|
24
|
-
-
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 09 Oct 2017 14:20:09 GMT
|
25
29
|
Content-Type:
|
26
30
|
- application/json; charset=utf-8
|
27
|
-
|
28
|
-
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
-
|
33
|
-
|
34
|
-
-
|
31
|
+
Etag:
|
32
|
+
- W/"59024f0b45c7aee36c00eaa89f2cce70"
|
33
|
+
Cache-Control:
|
34
|
+
- max-age=0, private, must-revalidate
|
35
|
+
X-Request-Id:
|
36
|
+
- 033725c9-6217-4ce6-b1af-37fd1c879b5b
|
37
|
+
X-Runtime:
|
38
|
+
- '0.011110'
|
39
|
+
Vary:
|
40
|
+
- Origin
|
41
|
+
Content-Security-Policy:
|
42
|
+
- 'default-src ''self''; child-src https://*.stripe.com headway-widget.net;
|
43
|
+
connect-src ''self'' https://api.bugsnag.com https://*.stripe.com https://bugsnag.zendesk.com
|
44
|
+
https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com; img-src
|
45
|
+
''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
|
46
|
+
script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
|
47
|
+
https://maxcdn.bootstrapcdn.com https://code.jquery.com https://assets.zendesk.com
|
48
|
+
https://cdn.headwayapp.co; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com'
|
35
49
|
X-Content-Type-Options:
|
36
50
|
- nosniff
|
51
|
+
X-Download-Options:
|
52
|
+
- noopen
|
37
53
|
X-Frame-Options:
|
38
|
-
-
|
39
|
-
X-
|
40
|
-
-
|
41
|
-
X-Request-Id:
|
42
|
-
- 87d16308-f667-4a49-a5f8-9dc6dd7ef1ed
|
43
|
-
X-Runtime:
|
44
|
-
- '0.005029'
|
54
|
+
- DENY
|
55
|
+
X-Permitted-Cross-Domain-Policies:
|
56
|
+
- none
|
45
57
|
X-Xss-Protection:
|
46
58
|
- 1; mode=block
|
47
|
-
|
48
|
-
-
|
49
|
-
|
50
|
-
-
|
59
|
+
X-Robots-Tag:
|
60
|
+
- noindex, nofollow
|
61
|
+
Strict-Transport-Security:
|
62
|
+
- max-age=31536000
|
63
|
+
Via:
|
64
|
+
- 1.1 google
|
65
|
+
Alt-Svc:
|
66
|
+
- clear
|
67
|
+
Transfer-Encoding:
|
68
|
+
- chunked
|
51
69
|
body:
|
52
|
-
encoding:
|
53
|
-
string: '{"
|
70
|
+
encoding: ASCII-8BIT
|
71
|
+
string: '{"organizations_url":"https://api.bugsnag.com/user/organizations"}'
|
54
72
|
http_version:
|
55
|
-
recorded_at:
|
56
|
-
recorded_with: VCR 2.9.
|
73
|
+
recorded_at: Mon, 09 Oct 2017 14:20:08 GMT
|
74
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,80 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.bugsnag.com/organizations/BUGSNAG_ORG_ID/collaborators
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"email":"BUGSNAG_COLLABORATOR_EMAIL"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Bugsnag API Ruby Gem 1.0.3
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
X-Version:
|
15
|
+
- '2'
|
16
|
+
Authorization:
|
17
|
+
- token BUGSNAG_AUTH_TOKEN
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
Accept:
|
21
|
+
- "*/*"
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- nginx
|
29
|
+
Date:
|
30
|
+
- Mon, 09 Oct 2017 14:25:26 GMT
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- W/"eca67f6d4d1539baf9ad49d57ffbb90c"
|
35
|
+
Cache-Control:
|
36
|
+
- max-age=0, private, must-revalidate
|
37
|
+
X-Request-Id:
|
38
|
+
- 25848079-82f1-4a59-9421-e64c084f31b3
|
39
|
+
X-Runtime:
|
40
|
+
- '0.456026'
|
41
|
+
Vary:
|
42
|
+
- Origin
|
43
|
+
X-Ratelimit-Limit:
|
44
|
+
- '10'
|
45
|
+
X-Ratelimit-Remaining:
|
46
|
+
- '7'
|
47
|
+
Content-Security-Policy:
|
48
|
+
- 'default-src ''self''; child-src https://*.stripe.com headway-widget.net;
|
49
|
+
connect-src ''self'' https://api.bugsnag.com https://*.stripe.com https://bugsnag.zendesk.com
|
50
|
+
https://api.lever.co; font-src ''self'' https://maxcdn.bootstrapcdn.com; img-src
|
51
|
+
''self'' data: https://notify.bugsnag.com https://*.stripe.com https://maxcdn.bootstrapcdn.com;
|
52
|
+
script-src ''self'' https://d2wy8f7a9ursnm.cloudfront.net https://*.stripe.com
|
53
|
+
https://maxcdn.bootstrapcdn.com https://code.jquery.com https://assets.zendesk.com
|
54
|
+
https://cdn.headwayapp.co; style-src ''self'' ''unsafe-inline'' https://maxcdn.bootstrapcdn.com'
|
55
|
+
X-Content-Type-Options:
|
56
|
+
- nosniff
|
57
|
+
X-Download-Options:
|
58
|
+
- noopen
|
59
|
+
X-Frame-Options:
|
60
|
+
- DENY
|
61
|
+
X-Permitted-Cross-Domain-Policies:
|
62
|
+
- none
|
63
|
+
X-Xss-Protection:
|
64
|
+
- 1; mode=block
|
65
|
+
X-Robots-Tag:
|
66
|
+
- noindex, nofollow
|
67
|
+
Strict-Transport-Security:
|
68
|
+
- max-age=31536000
|
69
|
+
Via:
|
70
|
+
- 1.1 google
|
71
|
+
Alt-Svc:
|
72
|
+
- clear
|
73
|
+
Transfer-Encoding:
|
74
|
+
- chunked
|
75
|
+
body:
|
76
|
+
encoding: ASCII-8BIT
|
77
|
+
string: '{"id":"59afc14140ab4d001de9d7f0","name":null,"email":"BUGSNAG_COLLABORATOR_EMAIL","two_factor_enabled":false,"two_factor_enabled_on":null,"password_updated_on":"2017-09-06T09:34:57.068Z","show_time_in_utc":true,"projects_url":"https://api.bugsnag.com/users/59afc14140ab4d001de9d7f0/projects","heroku":false,"recovery_codes_remaining":0,"is_admin":true,"pending_invitation":true,"last_request_at":null,"project_ids":["BUGSNAG_PROJECT_ID","59afb2f8d0e0b8001971def9","59afb2fad0e0b8001e71e05f","59afb2fbbf058b001e55ef61","59afc13ebf058b001e56358a","59afc168bf058b0023562dae","59b01c8cd0e0b8001972b987","59b01c8dd0e0b8001e72b5c8","59b01c8fd0e0b8001972b989","59b01cc3d0e0b8001e72b5ca","59b01cc4d0e0b80023727b93","59b01cc540ab4d001dea69ff","59b01cc9d0e0b8001972ba0b","59db4efc562ced00221047b9","59db858e562ced00271092cd","59db8590c1951b0026d5a314","59db8593c1951b0026d5a316","59db8594562ced002210765c"],"paid_for":false}'
|
78
|
+
http_version:
|
79
|
+
recorded_at: Mon, 09 Oct 2017 14:25:25 GMT
|
80
|
+
recorded_with: VCR 2.9.3
|