OSDN Git Service

Merge branch 'gist' of https://github.com/Andrew8xx8/gitlabhq into Andrew8xx8-gist
[wvm/gitlab.git] / spec / factories.rb
index 3205cab..b596f80 100644 (file)
@@ -86,9 +86,11 @@ FactoryGirl.define do
       target_branch "master" # pretend bcf03b5d~3
       source_branch "stable" # pretend bcf03b5d
       st_commits do
-        [Commit.new(project.repository.commit('bcf03b5d')),
-         Commit.new(project.repository.commit('bcf03b5d~1')),
-         Commit.new(project.repository.commit('bcf03b5d~2'))]
+        [
+          project.repository.commit('bcf03b5d').to_hash,
+          project.repository.commit('bcf03b5d~1').to_hash,
+          project.repository.commit('bcf03b5d~2').to_hash
+        ]
       end
       st_diffs do
         project.repo.diff("bcf03b5d~3", "bcf03b5d")
@@ -156,8 +158,7 @@ FactoryGirl.define do
       "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
     end
 
-    factory :deploy_key do
-      project
+    factory :deploy_key, class: 'DeployKey' do
     end
 
     factory :personal_key do
@@ -196,14 +197,22 @@ FactoryGirl.define do
     url
   end
 
-  factory :wiki do
+  factory :project_snippet do
+    project
+    author
     title
     content
-    user
+    file_name
+  end
+
+  factory :personal_snippet do
+    author
+    title
+    content
+    file_name
   end
 
   factory :snippet do
-    project
     author
     title
     content
@@ -226,4 +235,9 @@ FactoryGirl.define do
     url
     service
   end
+
+  factory :deploy_keys_project do
+    deploy_key
+    project
+  end
 end