diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-09-02 16:35:15 +0200 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-01-04 16:38:17 +0100 |
commit | 0103d5be960e620342c67436ddd64ca9e729d7a8 (patch) | |
tree | b4f2cdd4a5ef8f6c906d71c674cc5f13f791c889 /spec/lib/gitlab/utils_spec.rb | |
parent | b647ad96f6e7cd1e6ca078635bb1ea49ee7d589f (diff) | |
download | gitlab-ce-0103d5be960e620342c67436ddd64ca9e729d7a8.tar.gz |
Add config_options|variables to BuildMetadatakamil-refactor-ci-builds-v5
These are data columns that store runtime configuration
of build needed to execute it on runner and within pipeline.
The definition of this data is that once used, and when no longer
needed (due to retry capability) they can be freely removed.
They use `jsonb` on PostgreSQL, and `text` on MySQL (due to lacking
support for json datatype on old enough version).
Diffstat (limited to 'spec/lib/gitlab/utils_spec.rb')
-rw-r--r-- | spec/lib/gitlab/utils_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/utils_spec.rb b/spec/lib/gitlab/utils_spec.rb index f5a4b7e2ebf..8f5029b3565 100644 --- a/spec/lib/gitlab/utils_spec.rb +++ b/spec/lib/gitlab/utils_spec.rb @@ -197,4 +197,20 @@ describe Gitlab::Utils do end end end + + describe '.deep_indifferent_access' do + let(:hash) do + { "variables" => [{ "key" => "VAR1", "value" => "VALUE2" }] } + end + + subject { described_class.deep_indifferent_access(hash) } + + it 'allows to access hash keys with symbols' do + expect(subject[:variables]).to be_a(Array) + end + + it 'allows to access array keys with symbols' do + expect(subject[:variables].first[:key]).to eq('VAR1') + end + end end |