factory-bot
Why can't this Test::Unit test preserve the model across `post :create`?
I have 开发者_JAVA百科two models: User and Topic. Users can have many topics and topics belong to one user.[详细]
2023-03-04 14:54 分类:问答Problem with Factory_girl, association and after_initialize
I have a Family class so defined: class Family < ActiveRecord::Base after_initialize :initialize_family[详细]
2023-03-03 04:57 分类:问答Spork and cache_classes problem with rspec, factory_girl and datamapper
I\'ve got a problem with Spork test server. If I set config.cache_classes = false in config/environments/test.rb then specs start to rasie errors.[详细]
2023-03-03 03:49 分类:问答Testing against mass assignment
Maybe this isn\'t something that needs to be tested against, but I\'m learning so I don\'t think its wrong to test to the max.[详细]
2023-03-02 18:29 分类:问答Factory Girl not destroying objects properly
I am creating an object with several has_many associations. Everything with regards tob building the object works fine, but when I try to test the deletion of one of the children or parent, it does no[详细]
2023-03-01 09:33 分类:问答factory girl and nested_attributes in rails 3
I have 2 models, one which accepts attributes for the other and I\'m trying to find a clever way to use Factory girl to setup the data for both.[详细]
2023-02-27 03:14 分类:问答Factory_girl data is not being cleaned up
I am using factory girl for test data. I create a user object in a before(:each) block, and it runs through a few expectations just fine. If i run the tests again, the validation on the model fail bec[详细]
2023-02-25 13:02 分类:问答Rails 3 + Rspec 2: Validation failed: Email has already been taken
I have 2 models, User and Bucket. User has_many Buckets and a Bucket belongs_to a User. In factories.rb, I have:[详细]
2023-02-23 07:33 分类:问答MongoDB object / association oddity
so i had the following associations... Product embeds_many :pressings, :class_name => \"ProductPressing\"[详细]
2023-02-21 22:23 分类:问答How to create/build multiple instances of a factory in Factory Girl?
How do I create multiple records or multiple factories of the same class? I tried: Factory.define :user do |user|[详细]
2023-02-21 21:44 分类:问答