diff options
author | gitlabhq <m@gitlabhq.com> | 2011-10-09 00:36:38 +0300 |
---|---|---|
committer | gitlabhq <m@gitlabhq.com> | 2011-10-09 00:36:38 +0300 |
commit | 9ba1224867665844b117fa037e1465bb706b3685 (patch) | |
tree | 52fbfc1cdb55df21843965479c97be0c91121a9a /spec/factories.rb | |
parent | 93efff945215a4407afcaf0cba15ac601b56df0d (diff) | |
download | gitlab-ce-9ba1224867665844b117fa037e1465bb706b3685.tar.gz |
init commit
Diffstat (limited to 'spec/factories.rb')
-rw-r--r-- | spec/factories.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/factories.rb b/spec/factories.rb new file mode 100644 index 00000000000..457c08ba87d --- /dev/null +++ b/spec/factories.rb @@ -0,0 +1,43 @@ +require File.join(Rails.root, 'spec', 'factory') + +Factory.add(:project, Project) do |obj| + obj.name = Faker::Internet.user_name + obj.path = 'legit' + obj.code = 'LGT' +end + +Factory.add(:public_project, Project) do |obj| + obj.name = Faker::Internet.user_name + obj.path = 'legit' + obj.private_flag = false + obj.code = 'LGT' +end + +Factory.add(:user, User) do |obj| + obj.email = Faker::Internet.email + obj.password = "123456" + obj.name = Faker::Name.name + obj.password_confirmation = "123456" +end + +Factory.add(:admin, User) do |obj| + obj.email = Faker::Internet.email + obj.password = "123456" + obj.name = Faker::Name.name + obj.password_confirmation = "123456" + obj.admin = true +end + +Factory.add(:issue, Issue) do |obj| + obj.title = Faker::Lorem.sentence + obj.content = Faker::Lorem.sentences +end + +Factory.add(:note, Note) do |obj| + obj.note = Faker::Lorem.sentence +end + +Factory.add(:key, Key) do |obj| + obj.title = "Example key" + obj.key = File.read(File.join(Rails.root, "db", "pkey.example")) +end |