diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-15 18:08:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-15 18:08:20 +0300 |
commit | 4774fa00b74a9248b2d14fc424a8c2f1abb0a0de (patch) | |
tree | 1fe6da0110394a038cdd0c7ddb2b7bd2c528ff01 /spec/lib/gitlab/code_navigation_path_spec.rb | |
parent | 67441623767b3084d594288408bb078b2eb9f83e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/code_navigation_path_spec.rb')
-rw-r--r-- | spec/lib/gitlab/code_navigation_path_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/lib/gitlab/code_navigation_path_spec.rb b/spec/lib/gitlab/code_navigation_path_spec.rb index 443dcd522d7..07d4dfba622 100644 --- a/spec/lib/gitlab/code_navigation_path_spec.rb +++ b/spec/lib/gitlab/code_navigation_path_spec.rb @@ -12,6 +12,7 @@ describe Gitlab::CodeNavigationPath do let(:commit_sha) { sha } let(:path) { 'lib/app.rb' } + let(:lsif_path) { "/#{project.full_path}/-/jobs/#{job.id}/artifacts/raw/lsif/#{path}.json?file_type=lsif" } subject { described_class.new(project, commit_sha).full_json_path_for(path) } @@ -21,7 +22,15 @@ describe Gitlab::CodeNavigationPath do context 'when a pipeline exist for a sha' do it 'returns path to a file in the artifact' do - expect(subject).to eq("/#{project.full_path}/-/jobs/#{job.id}/artifacts/raw/lsif/#{path}.json?file_type=lsif") + expect(subject).to eq(lsif_path) + end + + context 'when passed commit sha is nil' do + let(:commit_sha) { nil } + + it 'returns path to a file in the artifact' do + expect(subject).to eq(lsif_path) + end end end @@ -29,7 +38,7 @@ describe Gitlab::CodeNavigationPath do let(:commit_sha) { project.commit.id } it 'returns path to a file in the artifact' do - expect(subject).to eq("/#{project.full_path}/-/jobs/#{job.id}/artifacts/raw/lsif/#{path}.json?file_type=lsif") + expect(subject).to eq(lsif_path) end end |