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
sequence(:name){|i| "Employee #{i}"}
sequence(:email){ |i| "employee#{i}@mozo.bar" }
password 'secret'
password { 'secret' }
trait :confirmed do
#confirmed_at { Time.now }
+3 -3
View File
@@ -4,13 +4,13 @@ FactoryBot.define do
association :user
association :supplier #TODO warning! this may create a different supplier than the one created by the associated table
trait :placed do
state 'placed'
state { 'placed' }
end
trait :active do
state 'active'
state { 'active' }
end
trait :cancelled do
state 'cancelled'
state { 'cancelled' }
end
end
end
+2 -2
View File
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :page do
locale 'en'
layout 'theme1'
locale { 'en' }
layout { 'theme1' }
end
end
+1 -1
View File
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :product do
sequence(:name){|i| "Product#{i}"}
price 34.95
price { 34.95 }
association :supplier
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :product_order do
quantity 1
quantity { 1 }
association :order
association :product
end
+1 -1
View File
@@ -2,7 +2,7 @@ FactoryBot.define do
factory :supplier do
sequence(:name){|i| "Supplier #{i}"}
trait :open do
open true
open { true }
end
end
end
+1 -1
View File
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :table do
number 22
number { 22 }
association :supplier
end
end
+3 -3
View File
@@ -1,11 +1,11 @@
FactoryBot.define do
factory :user do
sequence( :email ){|i| "test#{i}@example.com" }
password "secret"
password { "secret" }
trait :other_auth do
sequence( :email ){|i| "test-other-user#{i}@example.com" }
auth_data( {
auth_data {{
'info' => {
'nickname' => "UOther",
"name" => "USR Other",
@@ -15,7 +15,7 @@ FactoryBot.define do
"token" => "fbAuthToken234",
'expires' => false
}
})
}}
end
end
end