diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-09-13 08:11:48 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-09-13 08:11:48 +0000 |
commit | 71f3d48544cc0857c8d470b182f7e809de6a4642 (patch) | |
tree | dbd87cb2ab7746c29c296c242ea19ec96fbef0d2 /spec/models | |
parent | f45985a27727c98c8c5c4a879fe4fea974a06cc1 (diff) | |
parent | e358ae16b45602666e959ada5a193c1cb4addb0f (diff) | |
download | gitlab-ce-71f3d48544cc0857c8d470b182f7e809de6a4642.tar.gz |
Merge branch '42861-move-include-external-files-in-gitlab-ci-yml-from-starter-to-libre' into 'master'
Resolve "Move "include external files in .gitlab-ci.yml" from Starter to Libre"
Closes #42861
See merge request gitlab-org/gitlab-ce!21603
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/blob_viewer/gitlab_ci_yml_spec.rb | 10 | ||||
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb index bed364a8c14..01c555a7a90 100644 --- a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb +++ b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb @@ -2,22 +2,24 @@ require 'spec_helper' describe BlobViewer::GitlabCiYml do include FakeBlobHelpers + include RepoHelpers - let(:project) { build_stubbed(:project) } + let(:project) { create(:project, :repository) } let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } let(:blob) { fake_blob(path: '.gitlab-ci.yml', data: data) } + let(:sha) { sample_commit.id } subject { described_class.new(blob) } describe '#validation_message' do it 'calls prepare! on the viewer' do expect(subject).to receive(:prepare!) - subject.validation_message + subject.validation_message(project, sha) end context 'when the configuration is valid' do it 'returns nil' do - expect(subject.validation_message).to be_nil + expect(subject.validation_message(project, sha)).to be_nil end end @@ -25,7 +27,7 @@ describe BlobViewer::GitlabCiYml do let(:data) { 'oof' } it 'returns the error message' do - expect(subject.validation_message).to eq('Invalid configuration format') + expect(subject.validation_message(project, sha)).to eq('Invalid configuration format') end end end diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 14ccc2960bb..2216705c032 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -1743,7 +1743,7 @@ describe Ci::Pipeline, :mailer do create(:ci_pipeline, config: { rspec: { script: 'rake test' } }) end - it 'does not containyaml errors' do + it 'does not contain yaml errors' do expect(pipeline).not_to have_yaml_errors end end |