Commit dd0f6416 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Rename list_projects to projects

Rename `Sentry::Client::Projects#list_projects` to `projects`
parent a71b0626
......@@ -86,7 +86,7 @@ module ErrorTracking
end
def list_sentry_projects
{ projects: sentry_client.list_projects }
{ projects: sentry_client.projects }
end
def issue_details(opts = {})
......
......@@ -3,7 +3,7 @@
module Sentry
class Client
module Projects
def list_projects
def projects
projects = get_projects
handle_mapping_exceptions do
......
......@@ -24,12 +24,12 @@ describe Sentry::Client::Projects do
it { expect(subject.length).to eq(length) }
end
describe '#list_projects' do
describe '#projects' do
let(:sentry_list_projects_url) { 'https://sentrytest.gitlab.com/api/0/projects/' }
let(:sentry_api_response) { projects_sample_response }
let!(:sentry_api_request) { stub_sentry_request(sentry_list_projects_url, body: sentry_api_response) }
subject { client.list_projects }
subject { client.projects }
it_behaves_like 'calls sentry api'
......
......@@ -193,7 +193,7 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
it 'calls sentry client' do
expect(subject).to receive(:sentry_client).and_return(sentry_client)
expect(sentry_client).to receive(:list_projects).and_return(projects)
expect(sentry_client).to receive(:projects).and_return(projects)
result = subject.list_sentry_projects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment