Fix specyfing part_numbers in API

Recently I've implmented a way to get only specific parts from log API,
but the test and implementation were wrong. This commit fixes that.
This commit is contained in:
Piotr Sarnacki 2014-09-11 14:35:19 +02:00
parent 68a49057ca
commit 65a90fd5d7
2 changed files with 4 additions and 2 deletions

View File

@ -50,7 +50,7 @@ module Travis
end
def part_numbers
if numbers = options[:part_numbers]
if numbers = options['part_numbers']
numbers.is_a?(String) ? numbers.split(',').map(&:to_i) : numbers
end
end

View File

@ -58,7 +58,9 @@ describe 'Jobs' do
headers = { 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json; chunked=true' }
response = get "/jobs/#{job.id}/log", { part_numbers: '1,3,4' }, headers
response.should deliver_json_for(job.log, version: 'v2', params: { chunked: true})
body = JSON.parse(response.body)
body['log']['parts'].map { |p| p['number'] }.sort.should == [1, 3]
end
it 'responds with 406 when log is already aggregated' do