Commit e3890a26 authored by Mark Chao's avatar Mark Chao

Fix spec in EE which now trigger access to repository

parent 60b4d8e7
...@@ -339,7 +339,7 @@ describe Projects::MergeRequestsController do ...@@ -339,7 +339,7 @@ describe Projects::MergeRequestsController do
end end
context 'with a forked project' do context 'with a forked project' do
let(:forked_project) { fork_project(project, fork_owner) } let(:forked_project) { fork_project(project, fork_owner, repository: true) }
let(:fork_owner) { create(:user) } let(:fork_owner) { create(:user) }
before do before do
......
...@@ -6,7 +6,7 @@ describe QuickActions::InterpretService do ...@@ -6,7 +6,7 @@ describe QuickActions::InterpretService do
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:user3) { create(:user) } let(:user3) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, :public, group: group) } let(:project) { create(:project, :repository, :public, group: group) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:service) { described_class.new(project, current_user) } let(:service) { described_class.new(project, current_user) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'shared/issuable/_approvals.html.haml' do describe 'shared/issuable/_approvals.html.haml' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { build(:project) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:presenter) { merge_request.present(current_user: user) } let(:presenter) { merge_request.present(current_user: user) }
let(:approver_presenter) { double(any?: false, show_code_owner_tips?: true) } let(:approver_presenter) { double(any?: false, show_code_owner_tips?: true) }
......
require 'spec_helper' require 'spec_helper'
describe Projects::MilestonesController do describe Projects::MilestonesController do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:milestone) { create(:milestone, project: project) } let(:milestone) { create(:milestone, project: project) }
let(:issue) { create(:issue, project: project, milestone: milestone) } let(:issue) { create(:issue, project: project, milestone: milestone) }
......
...@@ -2180,7 +2180,7 @@ describe MergeRequest do ...@@ -2180,7 +2180,7 @@ describe MergeRequest do
end end
end end
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, author: author) } let(:merge_request) { create(:merge_request, source_project: project, author: author) }
let(:author) { create(:user) } let(:author) { create(:user) }
let(:approver) { create(:user) } let(:approver) { create(:user) }
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Issuable::BulkUpdateService do describe Issuable::BulkUpdateService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) } let(:project) { create(:project, :repository, namespace: user.namespace) }
def bulk_update(issuables, extra_params = {}) def bulk_update(issuables, extra_params = {})
bulk_update_params = extra_params bulk_update_params = extra_params
......
...@@ -685,8 +685,8 @@ describe MergeRequests::UpdateService, :mailer do ...@@ -685,8 +685,8 @@ describe MergeRequests::UpdateService, :mailer do
end end
context 'setting `allow_collaboration`' do context 'setting `allow_collaboration`' do
let(:target_project) { create(:project, :public) } let(:target_project) { create(:project, :repository, :public) }
let(:source_project) { fork_project(target_project) } let(:source_project) { fork_project(target_project, nil, repository: true) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:merge_request) do let(:merge_request) do
create(:merge_request, create(:merge_request,
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Milestones::DestroyService do describe Milestones::DestroyService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:milestone) { create(:milestone, title: 'Milestone v1.0', project: project) } let(:milestone) { create(:milestone, title: 'Milestone v1.0', project: project) }
before do before do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Notes::QuickActionsService do describe Notes::QuickActionsService do
shared_context 'note on noteable' do shared_context 'note on noteable' do
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:maintainer) { create(:user).tap { |u| project.add_maintainer(u) } } let(:maintainer) { create(:user).tap { |u| project.add_maintainer(u) } }
let(:assignee) { create(:user) } let(:assignee) { create(:user) }
......
...@@ -10,7 +10,7 @@ describe TodoService do ...@@ -10,7 +10,7 @@ describe TodoService do
let(:john_doe) { create(:user) } let(:john_doe) { create(:user) }
let(:skipped) { create(:user) } let(:skipped) { create(:user) }
let(:skip_users) { [skipped] } let(:skip_users) { [skipped] }
let(:project) { create(:project) } let(:project) { create(:project, :repository) }
let(:mentions) { 'FYI: ' + [author, assignee, john_doe, member, guest, non_member, admin, skipped].map(&:to_reference).join(' ') } let(:mentions) { 'FYI: ' + [author, assignee, john_doe, member, guest, non_member, admin, skipped].map(&:to_reference).join(' ') }
let(:directly_addressed) { [author, assignee, john_doe, member, guest, non_member, admin, skipped].map(&:to_reference).join(' ') } let(:directly_addressed) { [author, assignee, john_doe, member, guest, non_member, admin, skipped].map(&:to_reference).join(' ') }
let(:directly_addressed_and_mentioned) { member.to_reference + ", what do you think? cc: " + [guest, admin, skipped].map(&:to_reference).join(' ') } let(:directly_addressed_and_mentioned) { member.to_reference + ", what do you think? cc: " + [guest, admin, skipped].map(&:to_reference).join(' ') }
......
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