diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-09-07 21:18:26 +0200 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-09-07 21:18:26 +0200 |
commit | 95b296f8ac8578e142efd6a60a582be4da5b09be (patch) | |
tree | 9014eb0ae9730ec8fb32d1f76e277e92b8785631 /spec/lib/gitlab/ci/config_spec.rb | |
parent | cd72189fc0127e9993eebaba9569f912394cc5c9 (diff) | |
download | gitlab-ce-95b296f8ac8578e142efd6a60a582be4da5b09be.tar.gz |
Change ExternalFile to retrieve local file from repository instead of GitLab project
CE mirror of 03c6094997023d9c8875ced421a6c9ef39a4af44
Diffstat (limited to 'spec/lib/gitlab/ci/config_spec.rb')
-rw-r--r-- | spec/lib/gitlab/ci/config_spec.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/lib/gitlab/ci/config_spec.rb b/spec/lib/gitlab/ci/config_spec.rb index 57354e12aa3..b1c801ff052 100644 --- a/spec/lib/gitlab/ci/config_spec.rb +++ b/spec/lib/gitlab/ci/config_spec.rb @@ -127,6 +127,17 @@ describe Gitlab::Ci::Config do end context "when yml has valid 'includes' defined" do + let(:http_file_content) do + <<~HEREDOC + variables: + AUTO_DEVOPS_DOMAIN: domain.example.com + POSTGRES_USER: user + POSTGRES_PASSWORD: testing-password + POSTGRES_ENABLED: "true" + POSTGRES_DB: $CI_ENVIRONMENT_SLUG + HEREDOC + end + let(:local_file_content) { File.read("#{Rails.root}/spec/ee/fixtures/gitlab/ci/external_files/.gitlab-ci-template-1.yml") } let(:yml) do <<-EOS includes: @@ -139,7 +150,8 @@ describe Gitlab::Ci::Config do end before do - allow_any_instance_of(Kernel).to receive_message_chain(:open, :read).and_return(yml) + allow_any_instance_of(::Gitlab::Ci::ExternalFiles::ExternalFile).to receive(:local_file_content).and_return(local_file_content) + allow_any_instance_of(Kernel).to receive_message_chain(:open, :read).and_return(http_file_content) end it 'should return a composed hash' do @@ -167,7 +179,7 @@ describe Gitlab::Ci::Config do end end - context "when config has invalid 'includes' defined" do + context "when yml has invalid 'includes' defined" do let(:yml) do <<-EOS includes: invalid |