factory-bot
FactoryGirl and Associations
I have two classes and two factories: class User belongs_to :company end class Company has_many :users end[详细]
2023-03-28 14:58 分类:问答rspec with factory girl
I have the following factories: Factory.define :producer, :class => User do |f| f.sequence(:email) { |n| \"producer_#{n}@shit.com\" }[详细]
2023-03-28 06:58 分类:问答Rails time formatting test failing because it's one hour off?
I have the following method in one of my Rails classes: def human_departure_time \"#{departure_time.strftime(\"%A, %d %B %Y\")} at #{departure_time.strftime(\"%I:%M %p\")}\"[详细]
2023-03-28 03:15 分类:问答Updating records with Factory Girl factory
Using RSpec and Factory Girl, I create a record that when created, has associated \'hours\' records automatically created in after_create.[详细]
2023-03-27 16:51 分类:问答Factory Girl / Capybara deleting records from database mid-test?
Working with RSpec & Capybara, I\'m getting an interesting test failure mode which goes away with a few subtle rearrangements of lines in the test case...stuff that shouldn\'t matter.[详细]
2023-03-27 07:15 分类:问答Factory girl association
I\'ve written a rspec test which adds into my rubric some units. I have two models => Rubric and Units. Rubrics have many units.[详细]
2023-03-27 01:54 分类:问答Help Getting More Info Out of Rspec
I am getting the following failure from one of my tests. Failures: 1) InstrumentController POST create with valid params creates a new Instrument[详细]
2023-03-26 04:11 分类:问答Factory girl: create an object with an association to an existing object
I\'d like to create two objects that refer to another, single object that I\'ve created in the before(:each) block[详细]
2023-03-25 02:35 分类:问答Rails 3.1, Factory girl bug
Fixed. There was a bug in Rails. See https://github.com/rails/rails/issues/2333 I have a problem with Factory Girl Rails and Rails 3.1.0.rc5[详细]
2023-03-24 21:35 分类:问答Help me understand this syntax in railstutorial.org (the section on Factory Girl)
I am in chapter 7 of the railstutorial.org, and the author is starting to explain less and less of the syntax and details of the course.[详细]
2023-03-24 04:18 分类:问答