From bf6961cad85ab9a60f37f9b2974fb7bdd3975810 Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
Date: Tue, 6 Jun 2017 23:36:41 +0800
Subject: [PATCH] Just let the user to create the namespace

---
 spec/models/forked_project_link_spec.rb     | 4 ++--
 spec/services/projects/fork_service_spec.rb | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/spec/models/forked_project_link_spec.rb b/spec/models/forked_project_link_spec.rb
index 454550c9710..6e8d43f988c 100644
--- a/spec/models/forked_project_link_spec.rb
+++ b/spec/models/forked_project_link_spec.rb
@@ -2,8 +2,8 @@ require 'spec_helper'
 
 describe ForkedProjectLink, "add link on fork" do
   let(:project_from) { create(:project, :repository) }
-  let(:namespace) { create(:namespace) }
-  let(:user) { create(:user, namespace: namespace) }
+  let(:user) { create(:user) }
+  let(:namespace) { user.namespace }
 
   before do
     create(:project_member, :reporter, user: user, project: project_from)
diff --git a/spec/services/projects/fork_service_spec.rb b/spec/services/projects/fork_service_spec.rb
index f8eb34f2ef4..0df81f3abcb 100644
--- a/spec/services/projects/fork_service_spec.rb
+++ b/spec/services/projects/fork_service_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper'
 describe Projects::ForkService, services: true do
   describe 'fork by user' do
     before do
-      @from_namespace = create(:namespace)
-      @from_user = create(:user, namespace: @from_namespace )
+      @from_user = create(:user)
+      @from_namespace = @from_user.namespace
       avatar = fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")
       @from_project = create(:project,
                              :repository,
@@ -13,8 +13,8 @@ describe Projects::ForkService, services: true do
                              star_count: 107,
                              avatar: avatar,
                              description: 'wow such project')
-      @to_namespace = create(:namespace)
-      @to_user = create(:user, namespace: @to_namespace)
+      @to_user = create(:user)
+      @to_namespace = @to_user.namespace
       @from_project.add_user(@to_user, :developer)
     end
 
-- 
2.30.9