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:
parent
68a49057ca
commit
65a90fd5d7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user