mirror of
https://github.com/thoughtbot/factory_bot_rails.git
synced 2022-11-09 11:49:18 -05:00
Update ModelGenerator to generate dynamic attributes
This commit is contained in:
parent
9f4323f415
commit
01a23ffbe1
3 changed files with 6 additions and 6 deletions
|
@ -18,8 +18,8 @@ Feature:
|
|||
"""
|
||||
FactoryBot.define do
|
||||
factory :user do
|
||||
name "MyString"
|
||||
age 1
|
||||
name { "MyString" }
|
||||
age { 1 }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -38,7 +38,7 @@ Feature:
|
|||
"""
|
||||
FactoryBot.define do
|
||||
factory :user do
|
||||
name "MyString"
|
||||
name { "MyString" }
|
||||
end
|
||||
end
|
||||
"""
|
||||
|
|
|
@ -35,7 +35,7 @@ Feature: automatically load step definitions
|
|||
"""
|
||||
FactoryBot.define do
|
||||
factory :user do
|
||||
name "Frank"
|
||||
name { "Frank" }
|
||||
end
|
||||
end
|
||||
"""
|
||||
|
@ -73,7 +73,7 @@ Feature: automatically load step definitions
|
|||
"""
|
||||
FactoryBot.define do
|
||||
factory :factory_from_some_railtie, class: 'User' do
|
||||
name 'Artem'
|
||||
name { 'Artem' }
|
||||
end
|
||||
end
|
||||
"""
|
||||
|
|
|
@ -70,7 +70,7 @@ RUBY
|
|||
|
||||
def factory_attributes
|
||||
attributes.map do |attribute|
|
||||
"#{attribute.name} #{attribute.default.inspect}"
|
||||
"#{attribute.name} { #{attribute.default.inspect} }"
|
||||
end.join("\n")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue