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 ...@@ -86,7 +86,7 @@ module ErrorTracking
end end
def list_sentry_projects def list_sentry_projects
{ projects: sentry_client.list_projects } { projects: sentry_client.projects }
end end
def issue_details(opts = {}) def issue_details(opts = {})
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Sentry module Sentry
class Client class Client
module Projects module Projects
def list_projects def projects
projects = get_projects projects = get_projects
handle_mapping_exceptions do handle_mapping_exceptions do
......
...@@ -24,12 +24,12 @@ describe Sentry::Client::Projects do ...@@ -24,12 +24,12 @@ describe Sentry::Client::Projects do
it { expect(subject.length).to eq(length) } it { expect(subject.length).to eq(length) }
end end
describe '#list_projects' do describe '#projects' do
let(:sentry_list_projects_url) { 'https://sentrytest.gitlab.com/api/0/projects/' } let(:sentry_list_projects_url) { 'https://sentrytest.gitlab.com/api/0/projects/' }
let(:sentry_api_response) { projects_sample_response } let(:sentry_api_response) { projects_sample_response }
let!(:sentry_api_request) { stub_sentry_request(sentry_list_projects_url, body: sentry_api_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' it_behaves_like 'calls sentry api'
......
...@@ -193,7 +193,7 @@ describe ErrorTracking::ProjectErrorTrackingSetting do ...@@ -193,7 +193,7 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
it 'calls sentry client' do it 'calls sentry client' do
expect(subject).to receive(:sentry_client).and_return(sentry_client) 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 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