Don't return collections along with simple settings

This commit is contained in:
Piotr Sarnacki 2014-07-16 18:20:35 +02:00
parent 696185e3cd
commit 9ae3782975
2 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class Travis::Api::App
get '/:id/settings', scope: :private do
settings = service(:find_repo_settings, params).run
if settings
respond_with({ settings: settings.obfuscated }, version: :v2)
respond_with({ settings: settings.simple_attributes }, version: :v2)
else
status 404
end

View File

@ -51,6 +51,7 @@ describe 'Repos' do
it 'allows to get settings' do
response = get "repos/#{repo.id}/settings", {}, headers
JSON.parse(response.body)['settings'].should have_key('build_pushes')
JSON.parse(response.body)['settings'].should_not have_key('env_vars')
end
end