Commit b0ea7b3b authored by Robert Speicher's avatar Robert Speicher

Fix cross-project reference specs for new permission check

For simplicity's sake, since we're testing the actual referencing, we
just force the permission check to always be allowed.
parent 62282971
......@@ -90,6 +90,11 @@ module Gitlab::Markdown
let(:commit2) { project.repository.commit("HEAD~2") }
let(:reference) { "#{project2.path_with_namespace}@#{commit1.id}...#{commit2.id}" }
before do
allow_any_instance_of(described_class).
to receive(:user_can_reference_project?).and_return(true)
end
it 'links to a valid reference' do
doc = filter("See #{reference}")
......
......@@ -76,6 +76,11 @@ module Gitlab::Markdown
let(:commit) { project.repository.commit }
let(:reference) { "#{project2.path_with_namespace}@#{commit.id}" }
before do
allow_any_instance_of(described_class).
to receive(:user_can_reference_project?).and_return(true)
end
it 'links to a valid reference' do
doc = filter("See #{reference}")
......
......@@ -82,6 +82,11 @@ module Gitlab::Markdown
let(:issue) { create(:issue, project: project2) }
let(:reference) { "#{project2.path_with_namespace}##{issue.iid}" }
before do
allow_any_instance_of(described_class).
to receive(:user_can_reference_project?).and_return(true)
end
it 'links to a valid reference' do
doc = filter("See #{reference}")
......
......@@ -70,6 +70,11 @@ module Gitlab::Markdown
let(:merge) { create(:merge_request, source_project: project2) }
let(:reference) { "#{project2.path_with_namespace}!#{merge.iid}" }
before do
allow_any_instance_of(described_class).
to receive(:user_can_reference_project?).and_return(true)
end
it 'links to a valid reference' do
doc = filter("See #{reference}")
......
......@@ -69,6 +69,11 @@ module Gitlab::Markdown
let(:snippet) { create(:project_snippet, project: project2) }
let(:reference) { "#{project2.path_with_namespace}$#{snippet.id}" }
before do
allow_any_instance_of(described_class).
to receive(:user_can_reference_project?).and_return(true)
end
it 'links to a valid reference' do
doc = filter("See #{reference}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment