Commit f4f66ddb authored by Pedro Pombeiro's avatar Pedro Pombeiro

Ensure we preserve `#raw` attribute on expansion

parent cb835578
......@@ -471,15 +471,23 @@ RSpec.describe ExpandVariables do
end
with_them do
subject do
coll = Gitlab::Ci::Variables::Collection.new(variables)
let!(:collection) { Gitlab::Ci::Variables::Collection.new(variables) }
ExpandVariables.expand_variables_collection(coll, project_with_flag_enabled)
subject! do
ExpandVariables.expand_variables_collection(collection, project_with_flag_enabled)
end
it 'expands variables' do
is_expected.to eq(result)
end
it 'preserves raw attribute' do
collection.each do |v|
k = v[:key]
subject_item = subject.find { |sv| sv[:key] == k }
expect(subject_item.raw).to eq(v.raw)
end
end
end
end
end
......
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