Displaying 1 result from an estimated 1 matches for "membership_type_id".
2007 Apr 19
5
Best practice thoughts: Model helpers, mocks
...hods too.
Am I going down the right path here? (If so, I have a text mate
snippet that creates this stuff pretty quickly I can share)
module RenewalSpecHelper
def min_renewal_attribs
{
:member_id => 1,
:order_id => 1,
:date_renewed => Date.new(2007, 1, 1),
:membership_type_id => 1,
:shirt_size => ''M'',
:amount_due => ''5000''
}
end
def min_renewal
Renewal.new :attributes => min_renewal_attribs
end
def mock_renewal(stubs = {})
obj = mock_model(Renewal, {
:member_id => 1,
:date_r...