12 Mar '12, 3am

Do you know about the short, explicit Factory Girl invocation syntax?

March 11, 2012 Tagged: factory girl ruby tdd testing shoulda rspec Comments (View) Short, explicit test setups You probably know about this Factory Girl definition syntax: FactoryGirl.define do factory :user do name 'Connie Customer' end end But did you know about this Factory Girl invocation syntax? setup do @user = create(:user) end Or: setup do @user = build(:user) end Or: setup do post :create, user: attributes_for(:user) end It’s in there . Configuration for Test::Unit / Shoulda : class ActiveSupport::TestCase include FactoryGirl::Syntax::Methods end Configuration for RSpec : RSpec.configure do |config| config.include FactoryGirl::Syntax::Methods end

Full article: http://robots.thoughtbot.com/post/19162390206/short-expli...

Tweets

read about @fourfeetnine post for being short i guess i really got qualify to claim short as a guy XD

read about @fourfeetnine post for being short i...

fourfeetnine.com 20 Mar '12, 6pm

One of the things I notice people are always asking on Formspring is whether I feel insecure or unhappy with my height. Wh...

Fresh Guacamole Short: Stop Motion Food

Fresh Guacamole Short: Stop Motion Food

eatdrinkbetter.com 11 Mar '12, 10am

Director PES created this “Fresh Guacamole” short for Showtime, and it was too adorable not to share here. We talk about a...