Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 12:08:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 12:08:14 +0300
commitade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace (patch)
treecf4154332fc95283f58cccb1383e43b40485d91d /spec/lib
parentba836d98593d68d8d6c22c540e31c8031a786bd8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/banzai/filter/issuable_state_filter_spec.rb14
-rw-r--r--spec/lib/gitlab/code_navigation_path_spec.rb31
2 files changed, 31 insertions, 14 deletions
diff --git a/spec/lib/banzai/filter/issuable_state_filter_spec.rb b/spec/lib/banzai/filter/issuable_state_filter_spec.rb
index cb431df7551..5950b6878ef 100644
--- a/spec/lib/banzai/filter/issuable_state_filter_spec.rb
+++ b/spec/lib/banzai/filter/issuable_state_filter_spec.rb
@@ -156,20 +156,6 @@ describe Banzai::Filter::IssuableStateFilter do
expect(doc.css('a').last.text).to eq(merge_request.to_reference)
end
- it 'ignores reopened merge request references' do
- merge_request = create_merge_request(:opened)
-
- link = create_link(
- merge_request.to_reference,
- merge_request: merge_request.id,
- reference_type: 'merge_request'
- )
-
- doc = filter(link, context)
-
- expect(doc.css('a').last.text).to eq(merge_request.to_reference)
- end
-
it 'ignores locked merge request references' do
merge_request = create_merge_request(:locked)
diff --git a/spec/lib/gitlab/code_navigation_path_spec.rb b/spec/lib/gitlab/code_navigation_path_spec.rb
new file mode 100644
index 00000000000..cafe362c8c7
--- /dev/null
+++ b/spec/lib/gitlab/code_navigation_path_spec.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Gitlab::CodeNavigationPath do
+ context 'when there is an artifact with code navigation data' do
+ let(:project) { create(:project, :repository) }
+ let(:sha) { project.commit.id }
+ let(:build_name) { Gitlab::CodeNavigationPath::CODE_NAVIGATION_JOB_NAME }
+ let(:path) { 'lib/app.rb' }
+ let!(:pipeline) { create(:ci_pipeline, project: project, sha: sha) }
+ let!(:job) { create(:ci_build, pipeline: pipeline, name: build_name) }
+ let!(:artifact) { create(:ci_job_artifact, :lsif, job: job) }
+
+ subject { described_class.new(project, sha).full_json_path_for(path) }
+
+ it 'assigns code_navigation_build variable' do
+ expect(subject).to eq("/#{project.full_path}/-/jobs/#{job.id}/artifacts/raw/lsif/#{path}.json")
+ end
+
+ context 'when code_navigation feature is disabled' do
+ before do
+ stub_feature_flags(code_navigation: false)
+ end
+
+ it 'does not assign code_navigation_build variable' do
+ expect(subject).to be_nil
+ end
+ end
+ end
+end