Skip to content

FactoryBot.modify does not override gem factory #1743

@Set27

Description

@Set27

Description

I tried to get all factories from spree gem, but overriding some of the factories, in this case user factories. I add it them using require 'spree/testing_support/factories'inspec_helper.rb`.

But

Using FactoryBot.modify I get

  Factory not registered: "user"

Using FactoryBot.define I get

  Factory already registered: user

Reproduction Steps

https://github.com/Set27/factory_bot_overriding_issue

System configuration

factory_bot 6.5.1
rails 7.2.2.1
ruby 3.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions