search for: generate_valid_new_item

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

2008 Mar 02
0
Models are not initialised correctly with ''rake test'' in Merb 0.9.1
...rency_code ) uniqueness_of( :uuid ) end def initialize( *args ) super( *args ) self.uuid = UUID.random_create.to_s end end As you can see I overwrite initialize to set up the UUID when the model is instantiated. In my tests I have the following method which sets up an Item: def generate_valid_new_item item = Item.new do |i| i.name = random_item_name i.description = random_description i.vendor_id = random_vendor_id i.vendor_reference = random_vendor_reference i.amount = random_amount i.currency_code = random_currency_code i.image_url = random_homepage...