[rspec-users] Test case for file import

aslak hellesoy aslak.hellesoy at gmail.com
Wed Nov 14 05:20:31 EST 2007


On 11/14/07, Karni Karni <lists at ruby-forum.com> wrote:
> Karni Karni wrote:
> > aslak hellesoy wrote:
> >
> > Could u pls give any URL form u  written this code?
>
> Thanks for ur reply. But in my case the total code is in the controller.

It shouldn't be. Put business logic in the model.
http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model

> I' submitting the from to a specific action with CSV file.

Right. Then ask the model to pupulate rows with that CSV.

>
> Hoew can I pass my CSV file to that specific action

post :my_action, :csv => <<-EOF
this,is,some
very,nice,csv
EOF

Also, take a look at this:
http://www.catb.org/~esr/faqs/smart-questions.html

(You're asking for the whole solution - you're likely to be ignored if
you don't ask more specific ones. For example show us some spec code)

Aslak

> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list