15 Mar '12, 8pm

#rails #factory #test #agile

#rails #factory #test #agile

November 23, 2009 Tagged: testing factory girl fakes callbacks Comments (View) Ain’t no calla back girl Factory Girl now has callbacks thanks to Nate Sutton (a.k.a. fowlduck). There are three callbacks respectively called after Factory methods you already know: after_build Factory.build after_create Factory.create after_stub Factory.stub These come in handy in a number of common use cases. Basic has many associations Models: class Article < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base belongs_to :article end Factories: Factory.define :article do |article| article.body { "password" } end Factory.define :comment do |comment| comment.body { 'Great article!' } end Factory.define :article_with_comment, :parent => :article do |article| article.after_create { |a| Factory(:comment, :article => a) } end Nice. Callbacks let us do this: article = Facto...

Full article: http://robots.thoughtbot.com/post/254496652/aint-no-calla...

Tweets

Work It Girl ... featuring @KelsiDagger , @IvankaTrump , @JSCollection , & @ParisHilton

Work It Girl ... featuring @KelsiDagger , @Ivan...

high.heels.com 15 Mar '12, 4am

Who says office looks have to boring? Pull on your pencil skirt and add a colorful heel for an office look that is perfect...

The latest blog from the Zen Ginger Disco Mothership >>> Go team #BangsOnTheRun! @bangsandabun x x x x

The latest blog from the Zen Ginger Disco Mothe...

womensrunninguk.co.uk 15 Mar '12, 3pm

Zen girl Rhalou finds her inner Zen runner Thursday, 15 March, 2012 Having recently upped my training, I’ve been running a...

“New Girl” Writers Are Totes Judgy! @NewGirlonFOX @zooeydeschanel @gizmodo

“New Girl” Writers Are Totes Judgy! @NewGirlonF...

sprudge.com 15 Mar '12, 11pm

Coffee enthusiasts everywhere felt the painful sting of pop-culture mockery last night when The New Girl featured butt-of-...

New Diary Post! BAD GIRL CHUBBI!!!

New Diary Post! BAD GIRL CHUBBI!!!

bubzbeauty.com 16 Mar '12, 9pm

It's actually 4:41am right now so I really should be sleeping but I don't know why, I'm not tired at all! Probably gonna d...

PMS Asterisk*: Girl Gamers of Singapore | e27

PMS Asterisk*: Girl Gamers of Singapore | e27

e27.sg 15 Mar '12, 1am

Tang, leader of team Asterisk* and Esports Team Manager at Razer, recalls how she started playing video games as a child. ...

Share this on Facebook Tweet This! Email this via Gmail Email this to a friend? Get Shareaholic It felt so good last...

Share this on Facebook Tweet This! Email this v...

priorfatgirl.com 19 Mar '12, 11am

It felt so good last week having some down time. To not be a blogger, to just be… me. I taught my last week of Blogging fo...

How HOTTT is Rick Ross' Maybach Music girl... n...

singaporedaily.net 16 Mar '12, 11pm

Jessica Gomes is an Australian model of Singaporean Chinese (mother) and Portuguese heritage. Gomes was talent spotted whe...

Don't You Know that Grandma's the Fix-It Girl?

Don't You Know that Grandma's the Fix-It Girl?

treehugger.com 09 Mar '12, 2pm

© Jodi Spangler Jodi Spangler has worked a lot of interesting jobs. She climbed telephone poles for a while in Michigan (u...

@pabosoo

ebay.com.sg 21 Mar '12, 7am

It's been well over half a year since Xing debuted with their single In Your Hands last December, and the group is now bac...

nyctaxiphoto: I'm back!

nyctaxiphoto.com 15 Mar '12, 2pm

Did anyone miss me? Well I was never gone from the blogosphere, but I made this new years resolution to stop driving. It w...

A never before break from blogging. — Prior Fat...

priorfatgirl.com 11 Mar '12, 6pm

Blogging has become a big part of my life. A very large demand. I started this blog for me. A place to document my journey...