Re: [rspec-users] testing an action which requires picture

2008-11-20 Thread Nick Hoffman
On 2008-11-18, at 01:53, Mano ah wrote: Nick Hoffman wrote: On 2008-11-14, at 06:29, Mano ah wrote: image = Image.new image.blob= params[:image][:blob] image.save_picture end -- Hi Mano. It doesn't really matter whether or not your "picture" model interacts with a database

Re: [rspec-users] testing an action which requires picture

2008-11-17 Thread Mano ah
Thank you All the above specification passed. Now I want to test the return value. I mean def scan #--- if request.post? image = Image.new image.blob= params[:image][:blob] if image.save_picture @code = returns a barcode image value e

Re: [rspec-users] testing an action which requires picture

2008-11-17 Thread Mano ah
Nick Hoffman wrote: > On 2008-11-14, at 06:29, Mano ah wrote: >> image = Image.new >> >> image.blob= params[:image][:blob] >> >> image.save_picture >> >>end >> -- > > Hi Mano. It doesn't really matter whether or not your "picture" model > interacts with a database. Simply use

Re: [rspec-users] testing an action which requires picture

2008-11-14 Thread Nick Hoffman
On 2008-11-14, at 06:29, Mano ah wrote: can i know how to test a picture upload which dosent interact with db my code is def scan #--- if request.post? image = Image.new image.blob= params[:image][:blob] image.save_picture end -- Hi Mano. It doesn't really m

Re: [rspec-users] testing an action which requires picture

2008-11-14 Thread Mano ah
can i know how to test a picture upload which dosent interact with db my code is def scan #--- if request.post? image = Image.new image.blob= params[:image][:blob] image.save_picture end -- Posted via http://www.ruby-forum.com/. __

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Ramon Tayag
Hmm.. not sure what that error is. The veterans in here might be able to help you. The create action should work... btw, this is a model spec, not a controller spec, just in case you're a newbie. Ramon Tayag On Thu, Nov 13, 2008 at 8:48 PM, Mano ah <[EMAIL PROTECTED]> wrote: > Can I know what t

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Mano ah
Ramon Tayag wrote: > I suggest doing those tests in the model, not in the controller. Just > do that fixture thing for the controller spec to pass. But pass the > same thing in the model. Here's a sample of how I do it > > require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') >

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Ramon Tayag
I suggest doing those tests in the model, not in the controller. Just do that fixture thing for the controller spec to pass. But pass the same thing in the model. Here's a sample of how I do it require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ProductImage do befo

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Mano ah
Ramon Tayag wrote: > You can put that barcode in the spec/fixtures directory. However, > you'll need to manually place it there. > > Ramon Tayag ok. Also please can i know how to test sending an image using rspec. -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Ramon Tayag
You can put that barcode in the spec/fixtures directory. However, you'll need to manually place it there. Ramon Tayag On Thu, Nov 13, 2008 at 7:18 PM, Mano ah <[EMAIL PROTECTED]> wrote: > Actually i need to test sending a barcode image and also test a value > returned by it. > -- > Posted via h

Re: [rspec-users] testing an action which requires picture

2008-11-13 Thread Mano ah
Actually i need to test sending a barcode image and also test a value returned by it. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] testing an action which requires picture

2008-11-12 Thread David Chelimsky
On Wed, Nov 12, 2008 at 3:18 AM, Mano ah <[EMAIL PROTECTED]> wrote: > How can i test the action of a controller which requires picture? > > I mean, as part of the test I want to pass a picture (somekind of > fixture) and test to see if the result is correct I'm pretty sure you're looking for this:

[rspec-users] testing an action which requires picture

2008-11-12 Thread Mano ah
How can i test the action of a controller which requires picture? I mean, as part of the test I want to pass a picture (somekind of fixture) and test to see if the result is correct -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list