Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-07-19 15:13:49 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-07-19 15:13:49 +0300
commitfd4fd25d3c1f81b669711755eda07089353b86b3 (patch)
tree4c7044c82cf9e1a53374f0b82ec3fee9edb4a74f /spec
parent3779d76d6ef8eec8eb335fd005bff7178a74c26e (diff)
Fix passing a hash with string keys when fabricating a variable
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/ci/variables/collection/item_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/ci/variables/collection/item_spec.rb b/spec/lib/gitlab/ci/variables/collection/item_spec.rb
index adb3ff4321f..46874662edd 100644
--- a/spec/lib/gitlab/ci/variables/collection/item_spec.rb
+++ b/spec/lib/gitlab/ci/variables/collection/item_spec.rb
@@ -75,6 +75,14 @@ describe Gitlab::Ci::Variables::Collection::Item do
expect(resource).to eq variable
end
+ it 'supports using a hash with stringified values' do
+ variable = { 'key' => 'VARIABLE', 'value' => 'my value' }
+
+ resource = described_class.fabricate(variable)
+
+ expect(resource).to eq(key: 'VARIABLE', value: 'my value')
+ end
+
it 'supports using an active record resource' do
variable = create(:ci_variable, key: 'CI_VAR', value: '123')
resource = described_class.fabricate(variable)