Re: [Rails] how to test...
On 18 June 2011 10:04, Tom Allison <tom@tacocat.net> wrote:
> I have a not-so-rails process that I'm developing in Rails.
> The Rails part is all the admin/configuration stuff.
> the non-so-Rails is what it actually does.
>
> What it does is this:
> submit a form to a website
> wait for email report
> remove attachments
> do "stuff" with attachments
>
> I'm trying to figure out how I can TEST something like this without pounding
> away on 100's of web forms. They are "expensive" to generate and time
> consuming to wait for them.
Put all the clever stuff is in methods in models (mostly non
ActiveRecord models presumably) then your unit tests should be able to
test most of it using fake data without having to go off to the third
party website or wait for emails and so on. Then you just have to
check that the top level hangs together using a few end-to-end tests.
>
> right now I'm doing the primate approach of running the entire thing
> end-to-end and seeing what worked and what didn't.
>
> Also, along with this comes another question.
> How do I write to logs for these not-so-Rails processes?
Can't you use the logger in the normal way?
Colin
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home