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

Just let the user to create the namespace

parent d919f924
...@@ -2,8 +2,8 @@ require 'spec_helper' ...@@ -2,8 +2,8 @@ require 'spec_helper'
describe ForkedProjectLink, "add link on fork" do describe ForkedProjectLink, "add link on fork" do
let(:project_from) { create(:project, :repository) } let(:project_from) { create(:project, :repository) }
let(:namespace) { create(:namespace) } let(:user) { create(:user) }
let(:user) { create(:user, namespace: namespace) } let(:namespace) { user.namespace }
before do before do
create(:project_member, :reporter, user: user, project: project_from) create(:project_member, :reporter, user: user, project: project_from)
......
...@@ -3,8 +3,8 @@ require 'spec_helper' ...@@ -3,8 +3,8 @@ require 'spec_helper'
describe Projects::ForkService, services: true do describe Projects::ForkService, services: true do
describe 'fork by user' do describe 'fork by user' do
before do before do
@from_namespace = create(:namespace) @from_user = create(:user)
@from_user = create(:user, namespace: @from_namespace ) @from_namespace = @from_user.namespace
avatar = fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png") avatar = fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")
@from_project = create(:project, @from_project = create(:project,
:repository, :repository,
...@@ -13,8 +13,8 @@ describe Projects::ForkService, services: true do ...@@ -13,8 +13,8 @@ describe Projects::ForkService, services: true do
star_count: 107, star_count: 107,
avatar: avatar, avatar: avatar,
description: 'wow such project') description: 'wow such project')
@to_namespace = create(:namespace) @to_user = create(:user)
@to_user = create(:user, namespace: @to_namespace) @to_namespace = @to_user.namespace
@from_project.add_user(@to_user, :developer) @from_project.add_user(@to_user, :developer)
end end
......
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