factory-bot
Rails 3.1: How do i add an initializer that runs after gem initializers?
My scaffold generator stopped working after we updated factory girl.Here\'s why happened.First, my config file tries to set up certain defaults for scaffold generation, like so:[详细]
2023-04-13 05:26 分类:问答What's the difference between a fixture and a factory in my unit tests?
A little confused here, what is the difference between a factory 开发者_Go百科and a fixture? So I\'m using factory_girl, when I create an object using the factory, should it be persisted to the db?Or[详细]
2023-04-13 04:01 分类:问答RSpec test with factory_girl and will_paginate for associated objects
I am having problems with writing a test in rspec for will_paginate. The problem is that I have a model with an Owner that can have many pets. This leads to a factories.rb file that looks like this:[详细]
2023-04-11 07:18 分类:问答How to test a scenario that requires javascript to complete?
A project I\'m working on fetches data from a 3rd party service and caches it locally along with specific info for my app.[详细]
2023-04-09 10:22 分类:问答Why gives FactoryGirl such large ID's in my testcases?
I am using a Rails 2.3.x and Ruby 1.8.7 environment with FactoryGirl 1.3.3 (edit: version of FG has no influence as far as I can see)[详细]
2023-04-09 03:43 分类:问答Factory Girl + Mongoid embedded documents in fixtures
Let’s say you have the following mongoid documents: class User include Mongoid::Document embeds_one :name[详细]
2023-04-06 22:01 分类:问答Testing nested resources with RSpec
I am trying to create tests for nested resources in Rails. The relevant route definition is: resources :communities do[详细]
2023-04-06 10:54 分类:问答rspec / factory girl causing SystemStackError in Rails 3
I\'m getting this error when running rspec on a spec file: MYPATH/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419: stack level too deep (SystemStackError)[详细]
2023-04-06 05:15 分类:问答devise helper method, confirm! cannot be used/found within factory setup
all, language: Ruby on rails version: rails 3 gems in question: devise and factory_girl_rails I refered to https://github.com/plataformatec/devise/wiki/How-To:-Controllers-and-Views-tests-with-Rai[详细]
2023-04-05 21:31 分类:问答Cucumber and Rspec sharing factory girl factories
I\'m designing a test around rails using Cucumber and Rspec and I was 开发者_运维技巧wondering if it is good practice sharing the Factory Girl factory code between the Cucumber acceptance test and Rsp[详细]
2023-04-05 19:39 分类:问答