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.
This commit is contained in:
Robert Speicher 2015-04-14 16:32:28 -04:00
parent 62282971e0
commit b0ea7b3b3d
5 changed files with 25 additions and 0 deletions

View File

@ -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}")

View File

@ -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}")

View File

@ -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}")

View File

@ -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}")

View File

@ -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}")