Commit 9ff88831 authored by Stefano Tenuta's avatar Stefano Tenuta

Minor improvements following first MR review

Removed unnecessary to_s from Variables' key
Updated tests to avoid unnecessary as_json conversion
parent 638d8a9e
......@@ -49,7 +49,7 @@ module Gitlab
def build_variables(image)
image[:variables].to_a.map do |key, value|
{ key: key.to_s, value: value.to_s }
{ key: key, value: value.to_s }
end
end
end
......
......@@ -222,7 +222,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
{ 'name' => 'docker:stable-dind', 'entrypoint' => '/bin/sh',
'alias' => 'docker', 'command' => 'sleep 30', 'ports' => [], 'variables' => [] },
{ 'name' => 'mysql:latest', 'entrypoint' => nil,
'alias' => nil, 'command' => nil, 'ports' => [], 'variables' => [{ key: 'MYSQL_ROOT_PASSWORD', value: 'root123.' }.as_json] }])
'alias' => nil, 'command' => nil, 'ports' => [], 'variables' => [{ 'key' => 'MYSQL_ROOT_PASSWORD', 'value' => 'root123.' }] }])
expect(json_response['steps']).to eq(expected_steps)
expect(json_response['artifacts']).to eq(expected_artifacts)
expect(json_response['cache']).to eq(expected_cache)
......
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