woke factory girl
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :page do
|
||||
locale 'en'
|
||||
layout 'theme1'
|
||||
locale { 'en' }
|
||||
layout { 'theme1' }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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,6 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :product_order do
|
||||
quantity 1
|
||||
quantity { 1 }
|
||||
association :order
|
||||
association :product
|
||||
end
|
||||
|
||||
@@ -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,6 +1,6 @@
|
||||
FactoryBot.define do
|
||||
factory :table do
|
||||
number 22
|
||||
number { 22 }
|
||||
association :supplier
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user