search for: xmlimportspechelper

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

2008 May 17
5
Help needed
..._user(data) # email address must be unique for members @user = User.find_or_initialize_by_email(email) # save user if not existing if @user.new_record? @user.country = Country.find_by_short((data/:countryShort).inner_html) end end end ---- spec ------- module XmlImportSpecHelper def mock_xml_import xml_file = RAILS_ROOT + "/spec/fixtures/import-member.xml" xml = File.read(xml_file) @xml_import = XmlImport.new @xml_import.should_receive(:open).exactly(1).times. with("any-file-name.xml"). and_return(xml) end end...