Top "Factory-bot" questions

factory_bot is a Ruby gem that allows you to quickly define prototypes for each of your models and ask for instances with properties that are important to the test at hand.

How can I use FactoryBot in db/seeds?

Is it possible to do this? If so, how can you do it? Note: FactoryBot was previously named FactoryGirl

ruby-on-rails factory-bot seed
Faker is producing duplicate data when used in factory_girl

I'm trying to populate some fake data into a factory using the Faker gem: Factory.define :user do |user| user.…

ruby-on-rails factory-bot
How to create a model with a certain id using rspec and factory girl

I use: gem 'rails', '3.2.11' gem 'rspec-rails', '2.13.2' gem 'webrat', '0.7.3' gem 'factory_girl_rails', '4.1.0' …

ruby-on-rails ruby-on-rails-3 rspec2 factory-bot
Factory Girl: How to set up a has_many/through association

I've been struggling with setting up a has_many/through relationship using Factory Girl. I have the following models: class …

ruby-on-rails bdd factory-bot
Factory_Girl + RSpec: undefined method 'create' when create(:user)

Can't call "dummy = create(:user)" to create a user. Have gone back and forth for hours. /home/parreirat/backend-clone/Passworks/…

ruby-on-rails ruby rspec factory-bot
Using factory_girl in Rails with associations that have unique constraints. Getting duplicate errors

I'm working with a Rails 2.2 project working to update it. I'm replacing existing fixtures with factories (using factory_girl) and …

ruby-on-rails ruby unit-testing fixtures factory-bot
FactoryGirl: Factory not registered

I work on a project with a structure like: projects/warehouse/core projects/warehouse/products/bottles projects/warehouse/products/boxes …

rspec ruby-on-rails-3.2 factory-bot
Setup Factory Girl with Test::Unit and Shoulda

I'm trying to set up Factory Girl with Test::Unit and Shoulda in Ruby on Rails. I have installed the …

ruby-on-rails ruby shoulda factory-bot testunit
Ruby Gem: Uninitialized constant FactoryBot

Working on a Ruby gem and trying to use FactoryBot inside with RSpec. I have this in support/factory_bot.…

ruby factory-bot
NameError: uninitialized constant Factory

I'm following this tutorial to get started with TDD on rails with factory girl, rspec and i ran into this …

ruby-on-rails ruby rspec tdd factory-bot