I'm trying to stub out some service models that I have and I'd like to
use factory_girl as that's what I'm using for my AR models also. Is
this possible?
I just tried creating the class (in lib) and factory below to no
avail. I get wrong # of arguments. I'm not sure how factory_girl
reflects on that object to determine what params to pass in. Do I
need to define my stub class in some specific way?
class SomeStub
attr_accessor :name, :age
def initialize(name, age)
@name=name
@age=age
end
end
with Factory:
Factory.define :some_stub, :default_strategy => :build do |s|
s.name 'some stub'
s.age 456
end
--
Individuals over processes. Interactions over tools. Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, & Factory Girl:
http://thoughtbot.com/services/training
You received this message because you are subscribed to the "factory_girl" mailing list.
To post to this group, send email to
factor...@googlegroups.com
To unsubscribe from this group, send email to
factory_girl...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/factory_girl?hl=en