Skip to content

Commit

Permalink
Update path to get the XML for a specific error
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Gusev committed Oct 11, 2013
1 parent 8ae0dbf commit 04942a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/airbrake-api/client.rb
Expand Up @@ -58,7 +58,7 @@ def projects(options = {})
# errors

def unformatted_error_path(error_id)
"/groups/#{error_id}"
"/errors/#{error_id}"
end

def error_path(error_id)
Expand Down
2 changes: 1 addition & 1 deletion spec/airbrake_api/client_spec.rb
Expand Up @@ -219,7 +219,7 @@
end

it 'generates web urls for individual errors' do
@client.url_for(:error, 1696171).should eq('http://myapp.airbrake.io/groups/1696171')
@client.url_for(:error, 1696171).should eq('http://myapp.airbrake.io/errors/1696171')
end

it 'generates web urls for notices' do
Expand Down
2 changes: 1 addition & 1 deletion spec/airbrake_api/error_spec.rb
Expand Up @@ -12,7 +12,7 @@
end

it "should generate correct error path given an id" do
AirbrakeAPI::Error.error_path(1234).should == "/groups/1234.xml"
AirbrakeAPI::Error.error_path(1234).should == '/errors/1234.xml'
end

describe '.find' do
Expand Down
10 changes: 5 additions & 5 deletions spec/spec_helper.rb
Expand Up @@ -25,9 +25,9 @@ def fixture_request(verb, url, file)
# errors
fixture_request :get, 'http://myapp.airbrake.io/groups.xml?auth_token=abcdefg123456', 'errors.xml'
fixture_request :get, "http://myapp.airbrake.io/groups.xml?auth_token=abcdefg123456&page=2", 'paginated_errors.xml'
fixture_request :get, "http://myapp.airbrake.io/groups/1696170.xml?auth_token=abcdefg123456", 'individual_error.xml'
fixture_request :put, 'http://myapp.airbrake.io/groups/1696170?auth_token=abcdefg123456', 'update_error.xml'
fixture_request :get, 'https://anapp.airbrake.io/groups/1696170.xml?auth_token=abcdefg', 'individual_error.xml'
fixture_request :get, 'http://myapp.airbrake.io/errors/1696170.xml?auth_token=abcdefg123456', 'individual_error.xml'
fixture_request :put, 'http://myapp.airbrake.io/errors/1696170?auth_token=abcdefg123456', 'update_error.xml'
fixture_request :get, 'https://anapp.airbrake.io/errors/1696170.xml?auth_token=abcdefg', 'individual_error.xml'

# notices
fixture_request :get, "http://myapp.airbrake.io/groups/1696170/notices.xml?auth_token=abcdefg123456", 'notices.xml'
Expand All @@ -51,5 +51,5 @@ def fixture_request(verb, url, file)
fixture_request :get, "http://myapp.airbrake.io/projects/67890/deploys.xml?auth_token=abcdefg123456", 'empty_deploys.xml'

# ssl responses
fixture_request :get, "https://sslapp.airbrake.io/groups/1696170.xml?auth_token=abcdefg123456", 'individual_error.xml'
FakeWeb.register_uri(:get, "http://sslapp.airbrake.io/groups/1696170.xml?auth_token=abcdefg123456", DEFAULTS.merge(:body => " ", :status => ["403", "Forbidden"]))
fixture_request :get, "https://sslapp.airbrake.io/errors/1696170.xml?auth_token=abcdefg123456", 'individual_error.xml'
FakeWeb.register_uri(:get, "http://sslapp.airbrake.io/errors/1696170.xml?auth_token=abcdefg123456", DEFAULTS.merge(:body => " ", :status => ["403", "Forbidden"]))

0 comments on commit 04942a2

Please sign in to comment.