Skip to content

Rails 5 - Undefined Method for all factories #1272

@nbaki

Description

@nbaki

When using version 5.0.2 of the factory_bot_rails gem, my factories now all give me an Undefined Method error for all my registered factories. If I downgrade the version of the gem to 4.11 it works.

spec_helper.rb

RSpec.configure do |config|

  config.before(:suite) do
    FactoryBot.definition_file_paths = [File.expand_path('../factories', __FILE__)]
    FactoryBot.find_definitions
  end
...
end

I'm using Rails 5.2.

Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions