woke factory girl
This commit is contained in:
@@ -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 }
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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,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,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
|
||||||
|
|||||||
@@ -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,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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user