summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2019-01-07 09:19:36 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-01-07 09:19:36 +0000
commit604073ffc38f938e36f613c592c444d56c99f49c (patch)
treea741c7e6bb3dd9d189be82c7f4c0e8147f19dd89 /spec/models
parent301315f3b3e5ffe43c3de1f7f15e4e3a307c0912 (diff)
parentc4d615c9dcba6815d0e9d1b7b7de5b7528ac7c72 (diff)
downloadgitlab-ce-604073ffc38f938e36f613c592c444d56c99f49c.tar.gz
Merge branch 'include-project' into 'master'
Allow to include another project files Closes #53903 See merge request gitlab-org/gitlab-ce!24101
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/blob_viewer/gitlab_ci_yml_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb
index 01c555a7a90..16bf947b493 100644
--- a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb
+++ b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb
@@ -4,7 +4,9 @@ describe BlobViewer::GitlabCiYml do
include FakeBlobHelpers
include RepoHelpers
- let(:project) { create(:project, :repository) }
+ set(:project) { create(:project, :repository) }
+ set(:user) { create(:user) }
+
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 }
@@ -14,12 +16,12 @@ describe BlobViewer::GitlabCiYml do
it 'calls prepare! on the viewer' do
expect(subject).to receive(:prepare!)
- subject.validation_message(project, sha)
+ subject.validation_message(project: project, sha: sha, user: user)
end
context 'when the configuration is valid' do
it 'returns nil' do
- expect(subject.validation_message(project, sha)).to be_nil
+ expect(subject.validation_message(project: project, sha: sha, user: user)).to be_nil
end
end
@@ -27,7 +29,7 @@ describe BlobViewer::GitlabCiYml do
let(:data) { 'oof' }
it 'returns the error message' do
- expect(subject.validation_message(project, sha)).to eq('Invalid configuration format')
+ expect(subject.validation_message(project: project, sha: sha, user: user)).to eq('Invalid configuration format')
end
end
end