search for: membership_type1

Displaying 1 result from an estimated 1 matches for "membership_type1".

2007 Apr 19
5
Best practice thoughts: Model helpers, mocks
...@name; end" obj end end Below is an example of what I''d like to avoid, one of my controller test setups. It seems like each context, I end up pasting the previous contexts setup, and then adding a few more lines, until it ends up... setup do mem_types = Array.new @membership_type1 = mock_model(MembershipType) @membership_type1.stub!(:id).and_return(1) @membership_type1.stub!(:name).and_return(''Name'') @membership_type1.stub!(:price_cents).and_return(5000) mem_types << @membership_type1 @membership_type2 = mock_model(MembershipType)...