diff --git a/features/generators.feature b/features/generators.feature index 2227e2c..7fa3963 100644 --- a/features/generators.feature +++ b/features/generators.feature @@ -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 """ diff --git a/features/load_definitions.feature b/features/load_definitions.feature index 13055af..2a21163 100644 --- a/features/load_definitions.feature +++ b/features/load_definitions.feature @@ -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 """ diff --git a/lib/generators/factory_bot/model/model_generator.rb b/lib/generators/factory_bot/model/model_generator.rb index 95e993a..d5a49eb 100644 --- a/lib/generators/factory_bot/model/model_generator.rb +++ b/lib/generators/factory_bot/model/model_generator.rb @@ -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