woke factory girl

This commit is contained in:
Benjamin
2021-04-21 17:21:58 -05:00
parent 46fc427694
commit f96ae22388
8 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ FactoryBot.define do
factory :employee do factory :employee do
sequence(:name){|i| "Employee #{i}"} sequence(:name){|i| "Employee #{i}"}
sequence(:email){ |i| "employee#{i}@mozo.bar" } sequence(:email){ |i| "employee#{i}@mozo.bar" }
password 'secret' password { 'secret' }
trait :confirmed do trait :confirmed do
#confirmed_at { Time.now } #confirmed_at { Time.now }
+3 -3
View File
@@ -4,13 +4,13 @@ FactoryBot.define do
association :user association :user
association :supplier #TODO warning! this may create a different supplier than the one created by the associated table association :supplier #TODO warning! this may create a different supplier than the one created by the associated table
trait :placed do trait :placed do
state 'placed' state { 'placed' }
end end
trait :active do trait :active do
state 'active' state { 'active' }
end end
trait :cancelled do trait :cancelled do
state 'cancelled' state { 'cancelled' }
end end
end end
end end
+2 -2
View File
@@ -1,6 +1,6 @@
FactoryBot.define do FactoryBot.define do
factory :page do factory :page do
locale 'en' locale { 'en' }
layout 'theme1' layout { 'theme1' }
end end
end end
+1 -1
View File
@@ -1,7 +1,7 @@
FactoryBot.define do FactoryBot.define do
factory :product do factory :product do
sequence(:name){|i| "Product#{i}"} sequence(:name){|i| "Product#{i}"}
price 34.95 price { 34.95 }
association :supplier association :supplier
end end
end end
+1 -1
View File
@@ -1,6 +1,6 @@
FactoryBot.define do FactoryBot.define do
factory :product_order do factory :product_order do
quantity 1 quantity { 1 }
association :order association :order
association :product association :product
end end
+1 -1
View File
@@ -2,7 +2,7 @@ FactoryBot.define do
factory :supplier do factory :supplier do
sequence(:name){|i| "Supplier #{i}"} sequence(:name){|i| "Supplier #{i}"}
trait :open do trait :open do
open true open { true }
end end
end end
end end
+1 -1
View File
@@ -1,6 +1,6 @@
FactoryBot.define do FactoryBot.define do
factory :table do factory :table do
number 22 number { 22 }
association :supplier association :supplier
end end
end end
+3 -3
View File
@@ -1,11 +1,11 @@
FactoryBot.define do FactoryBot.define do
factory :user do factory :user do
sequence( :email ){|i| "test#{i}@example.com" } sequence( :email ){|i| "test#{i}@example.com" }
password "secret" password { "secret" }
trait :other_auth do trait :other_auth do
sequence( :email ){|i| "test-other-user#{i}@example.com" } sequence( :email ){|i| "test-other-user#{i}@example.com" }
auth_data( { auth_data {{
'info' => { 'info' => {
'nickname' => "UOther", 'nickname' => "UOther",
"name" => "USR Other", "name" => "USR Other",
@@ -15,7 +15,7 @@ FactoryBot.define do
"token" => "fbAuthToken234", "token" => "fbAuthToken234",
'expires' => false 'expires' => false
} }
}) }}
end end
end end
end end