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.

FactoryGirl + RSpec + Rails 3 'undefined method <attribute>='

I'm fairly new to rails and TDD (as will no doubt be obvious from my post) and am having a …

ruby-on-rails-3 rspec2 factory-bot
How to pass parameters through the associations chain in FactoryGirl

By default, FactoryGirl calls the factories of associations to create them. I can pass a association for a factory as …

ruby-on-rails ruby factory-bot
Does a framework like Factory Girl exist for Java?

Factory Girl is a handy framework in rails for easily creating instances of models for testing. From the Factory Girl …

java ruby-on-rails unit-testing factory factory-bot
RSpec failure: could not find table after migration...?

I have a naked rails 3 app with one model, generated using rails g model User. I've added a factory (using …

ruby-on-rails ruby-on-rails-3 rspec factory-bot
Machinist vs FactoryGirl - pros and cons

I'm working with factory_girl, but looking at the machinist gem. Could you tell me please - what are the …

ruby-on-rails ruby testing factory-bot machinist
undefined method `create' rails spec.

I have installed factory girl and trying to use it with spec. scenario 'User signs in' do create :user, email: …

rspec factory-bot
FactoryGirl screws up rake db:migrate process

I am doing TDD/BDD in Ruby on Rails 3 with Rspec (2.11.0) and FactoryGirl (4.0.0). I have a factory for a Category …

ruby-on-rails rspec rake bdd factory-bot
What's the difference between mock, stub, and factory girl?

I'm pretty new to rspec and the whole TDD methodology. Can someone please explain the difference between mock and stub. …

ruby-on-rails rspec mocking factory-bot
Why would rails not reset the test database between runs

There are comments in the rails codebase that indicate that the test database should be reset between runs rake -T …

ruby-on-rails testing factory-bot minitest
How to test that a file is uploaded in a controller?

I'm trying to test that my user has a photo value when I upload an image. It works fine in …

ruby-on-rails-4 rspec carrierwave factory-bot uploader