Change artifacts and cache fields to arrays
This commit is contained in:
parent
2956f0a6f5
commit
0905fe4d7a
|
@ -524,11 +524,11 @@ module Ci
|
||||||
end
|
end
|
||||||
|
|
||||||
def artifacts
|
def artifacts
|
||||||
options[:artifacts]
|
[options[:artifacts]]
|
||||||
end
|
end
|
||||||
|
|
||||||
def cache
|
def cache
|
||||||
options[:cache]
|
[options[:cache]]
|
||||||
end
|
end
|
||||||
|
|
||||||
def credentials
|
def credentials
|
||||||
|
|
|
@ -308,11 +308,16 @@ describe API::Runner do
|
||||||
{ 'key' => 'DB_NAME', 'value' => 'postgres', 'public' => true }]
|
{ 'key' => 'DB_NAME', 'value' => 'postgres', 'public' => true }]
|
||||||
end
|
end
|
||||||
let(:expected_artifacts) do
|
let(:expected_artifacts) do
|
||||||
{ 'name' => 'artifacts_file',
|
[{ 'name' => 'artifacts_file',
|
||||||
'untracked' => false,
|
'untracked' => false,
|
||||||
'paths' => %w(out/),
|
'paths' => %w(out/),
|
||||||
'when' => 'always',
|
'when' => 'always',
|
||||||
'expire_in' => '7d' }
|
'expire_in' => '7d' }]
|
||||||
|
end
|
||||||
|
let(:expected_cache) do
|
||||||
|
[{ 'key' => 'cache_key',
|
||||||
|
'untracked' => false,
|
||||||
|
'paths' => ['vendor/*'] }]
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'starts a job' do
|
it 'starts a job' do
|
||||||
|
@ -329,6 +334,7 @@ describe API::Runner do
|
||||||
expect(json_response['services']).to eq([{ 'name' => 'postgres' }])
|
expect(json_response['services']).to eq([{ 'name' => 'postgres' }])
|
||||||
expect(json_response['steps']).to eq(expected_steps)
|
expect(json_response['steps']).to eq(expected_steps)
|
||||||
expect(json_response['artifacts']).to eq(expected_artifacts)
|
expect(json_response['artifacts']).to eq(expected_artifacts)
|
||||||
|
expect(json_response['cache']).to eq(expected_cache)
|
||||||
expect(json_response['variables']).to include(*expected_variables)
|
expect(json_response['variables']).to include(*expected_variables)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue