Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Group info
Language: English
Group categories: Not categorized
More group info »
Discussions
View:  Topic list, Topic summary Topics 1 - 10 of 277  Older »

You cannot post messages because only members can post, and you are not currently a member.
Description: Discussion and assistance related to the factory_girl Gem for Ruby.
 

How to access the curent factories attributes 
  Lets say I have the following factory: FactoryGirl.define do factory :user do first_name: { Faker::Name.first_name } last_name: { Faker::Name.last_name } user_name: { "#{first_name.first}_#{last_na me}" } end end Quite obviously this doesn't work, but how can I make it work to access the... more »
By Jason Waldrip  - May 22 - 3 new of 3 messages    

separate use of factory_girl and factory_girl_rails? 
  I have an application that uses Redis::Objects in some models (no AR) and ActiveRecord::Base for traditional Rails models. Is there a way for me to use FactoryGirl for the former yet FactoryGirlRails for the latter?
By Martin Streicher  - May 17 - 8 new of 8 messages    

Sharing factories via a gem? 
  I have a set of models that are shared between Rails applications, and currently live in a gem. I would like to share the factories that are associated with them as well. Whats the best way to do this? Don't necessarily want to have to write a generator and dump them out, would prefer to include them somehow.... more »
By Justin Wiley  - May 16 - 3 new of 3 messages    

polymorphic association error .. 
  I have the following models class Partner < ActiveRecord::Base has_many :payment_terms, :dependent => :destroy, :as => :term able class PaymentTerm < ActiveRecord::Base belongs_to :termable, :polymorphic => true I defined the payment_term factory like that : FactoryGirl.define do... more »
By kadoudal  - May 15 - 2 new of 2 messages    

add_attribute': Both value and block given 
  I am trying to add (my first) after(;create in a factory, and I get this error ... gems/factory_girl-3.2.0/lib/fa ctory_girl/definition_proxy.rb :36:in `add_attribute': Both value and block given (FactoryGirl::AttributeDefinit ionError) I have an Admin model class Admin < ActiveRecord::Base... more »
By kadoudal  - May 9 - 5 new of 5 messages    

how to force an associated object when seeding data 
  I am trying to seed data in my test DB using factory_girls I have some static data created like : puts "CREATE AREAS" west = Area.create(name: "West) north = Area.create(name: "North) east = Area.create(name: "East) south = Area.create(name: "South) .. and I wrote FactoryGirl.define do factory :partner do... more »
By kadoudal  - May 8 - 6 new of 6 messages    

How does FG track named associations in it's step definitions? 
  I've seen this in examples but I just wanted to understand better how it works. This is a contrived example based off of FG's own functional tests: Scenario: create post with and without a category association Given the following users exist: | ID | Name | | 123 | Joe | And the following posts exist:... more »
By Chris Bloom  - May 8 - 3 new of 3 messages    

problem setting conditional values for associations 
  With the old factory girl, we had quite a few factories like this: Factory.define :thing do |t| t.project {|f| if user = f.get(:user) f.association(:project, :account => user.account) else f.association(:project) end}... more »
By Morgan Whitney  - May 7 - 3 new of 3 messages    

Transient attribute gives "undefined method `name' for false:FalseClass" 
  The code below work if I substitute the "sub" on the last line with a number say 99. Why can I not access the transient attribute "sub" when setting this association? factory :tx_link do units 9.99 factory :link_to_sub do ignore do sub 0 end units { sub } giver { |tx| tx.association(:transaction, units: sub) }... more »
By AQ  - May 3 - 3 new of 3 messages    

"curl: (3) <url> malformed" error 
  Hi all, I am using factory_girl (3.2.0) in Rspec tests and have been getting an error (curl: (3) <url> malformed) when I call FactoryGirl.create (and FactoryGirl.build) for one of my Models. I have traced the error to what I believe to be something in the FactoryGirl callback methods (rather than my Model) since creating a Model without FactoryGirl... more »
By JayOheN  - May 2 - 3 new of 3 messages    

1 - 10 of 277   « Newer | Older »

XML       Send email to this group: factory_girl@googlegroups.com