Ranieri Teixeira
2007-Oct-12 04:52 UTC
Can I run ERb instructions in a test fixture YML file?
I think that fixtures file must contains raw (final value) data. By using a file from the ebook "Build Your Own Ruby on Rails Web Applications" by Patrick Lenz, I''ve trying to run the line "created_at: <% Time.now.to_s(:db) %>" from the file ''votes.yml''. But, the functional tests has reported a error, showing that the object created_at, don''t was created at a rjs template. When I''ve added a new line to "created_at: 2007-10-09 22:49:19", the tests were finished with no errors. So, the question: Can I run ERb instructions in a test fixture YML file? Thanks, Ranieri Teixeira --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Oct-12 08:45 UTC
Re: Can I run ERb instructions in a test fixture YML file?
On 12 Oct 2007, at 05:52, Ranieri Teixeira wrote:> I''ve trying to run the line > "created_at: <% Time.now.to_s(:db) %>" from the file ''votes.yml''. But, > the functional tests has reported a error, showing that the object > created_at, don''t was created at a rjs template. When I''ve added a new > line to "created_at: 2007-10-09 22:49:19", the tests were finished > with no errors. > So, the question: Can I run ERb instructions in a test fixture YML > file? >Yes you can but you need an erb output block, i.e. <%= ... %> and not <% ... %> Fred