Update ModelGenerator to generate dynamic attributes

This commit is contained in:
Atul Bhosale 2018-08-25 02:18:00 +05:30 committed by Daniel Colson
parent 9f4323f415
commit 01a23ffbe1
3 changed files with 6 additions and 6 deletions

View File

@ -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
"""

View File

@ -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
"""

View File

@ -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