diff options
Diffstat (limited to 'spec/services/ci/parse_dotenv_artifact_service_spec.rb')
-rw-r--r-- | spec/services/ci/parse_dotenv_artifact_service_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/services/ci/parse_dotenv_artifact_service_spec.rb b/spec/services/ci/parse_dotenv_artifact_service_spec.rb index 7b3af33ac72..f720375f05c 100644 --- a/spec/services/ci/parse_dotenv_artifact_service_spec.rb +++ b/spec/services/ci/parse_dotenv_artifact_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Ci::ParseDotenvArtifactService do +RSpec.describe Ci::ParseDotenvArtifactService, feature_category: :build_artifacts do let_it_be(:project) { create(:project) } let_it_be(:pipeline) { create(:ci_pipeline, project: project) } @@ -223,6 +223,18 @@ RSpec.describe Ci::ParseDotenvArtifactService do end end + context 'when blob is encoded in UTF-16 LE' do + let(:blob) { File.read(Rails.root.join('spec/fixtures/build_artifacts/dotenv_utf16_le.txt')) } + + it 'parses the dotenv data' do + subject + + expect(build.job_variables.as_json(only: [:key, :value])).to contain_exactly( + hash_including('key' => 'MY_ENV_VAR', 'value' => 'true'), + hash_including('key' => 'TEST2', 'value' => 'false')) + end + end + context 'when more than limitated variables are specified in dotenv' do let(:blob) do StringIO.new.tap do |s| |