Commit a85eed64 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fake out Repository#fetch_ref for merge request if

the project didn't have a repository setup. We don't
try to stub it if the repository was already there.
parent 029fb98b
......@@ -68,6 +68,16 @@ FactoryGirl.define do
merge_user author
end
after(:build) do |merge_request|
target_project = merge_request.target_project
# Fake `fetch_ref` if we don't have repository
# We have too many existing tests replying on this behaviour
unless target_project.repository_exists?
allow(target_project.repository).to receive(:fetch_ref)
end
end
factory :merged_merge_request, traits: [:merged]
factory :closed_merge_request, traits: [:closed]
factory :reopened_merge_request, traits: [:opened]
......
......@@ -52,8 +52,8 @@ feature 'Task Lists' do
before do
Warden.test_mode!
project.team << [user, :master]
project.team << [user2, :guest]
project.add_master(user)
project.add_guest(user2)
login_as(user)
end
......@@ -246,7 +246,6 @@ feature 'Task Lists' do
end
describe 'multiple tasks' do
let(:project) { create(:project, :repository) }
let!(:merge) { create(:merge_request, :simple, description: markdown, author: user, source_project: project) }
it 'renders for description' do
......
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