diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/lib/gitlab/code_navigation_path_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/lib/gitlab/code_navigation_path_spec.rb')
-rw-r--r-- | spec/lib/gitlab/code_navigation_path_spec.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/lib/gitlab/code_navigation_path_spec.rb b/spec/lib/gitlab/code_navigation_path_spec.rb index 938a2f821fd..07d4dfba622 100644 --- a/spec/lib/gitlab/code_navigation_path_spec.rb +++ b/spec/lib/gitlab/code_navigation_path_spec.rb @@ -12,12 +12,25 @@ 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) } + before do + stub_feature_flags(code_navigation: project) + end + 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 @@ -25,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 |