[rspec-users] rspec - undefined method `describe' for main:Object

2008-10-09 Thread Mano ah
When i run a spec file i am getting the following error D:\Diwakar\spec_diwa\spec\controllers>spec sandbox_controller_spec.rb c:/ruby/lib/ruby/gems/1.8/gems/rspec-0.5.15/lib/spec/api/sugar.rb:17:in `method_ missing': undefined method `describe' for main:Object (NoMethodError) from ./sa

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
Dear Scott, I am new to rspec and i am confused to test using it. Can you please help me with an easy example or link to get clear about it Regards M -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.o

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
How to solve the below error 1) NoMethodError in 'LoginController index should get successfully' You have a nil object when you didn't expect it! The error occurred while evaluating nil.status ./login_controller_spec.rb:9: 2) NoMethodError in 'LoginController index should render 202 file' undefin

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
rails 2.1.1 and rspec 1.1.8 never worked out for me So i downgraded rails to 1.2.3. while execiting ruby /script/generate rspec_controller MyController it ask rails version 2.1.1. i was getting the describe method error as mention earlier in using 2.1.1 -- Posted via http://www.ruby-forum.

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
Scott Taylor wrote: > On Oct 11, 2008, at 12:42 AM, Mano ah wrote: > >> 2.1.1 > Why don't you post your spec? It would be a lot easier to help if we > could look at the same thing you were looking at. > > Scott sorry spec? -- Posted

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
Luis Lavena wrote: > On Fri, Oct 10, 2008 at 3:56 AM, Mano ah <[EMAIL PROTECTED]> wrote: >> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:28:in `ge >> >> describe SandboxController,"handling someaction" do >> >>@value = somemethod &

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-10 Thread Mano ah
my gem list is actionmailer (2.1.1, 1.3.3) actionpack (2.1.1, 1.13.3) actionwebservice (1.2.3) activerecord (2.1.1, 1.15.3) activeresource (2.1.1) activesupport (2.1.1, 1.4.2) fxri (0.3.6) fxruby (1.6.12) hoe (1.7.0) hpricot (0.6) log4r (1.0.5) rails (1.2.3) rake (0.8.3) rspec (1.1.8, 0.5.15) rs

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-11 Thread Mano ah
I followed the below ways of installation gem install rake gem install rails gem install rspec gem install rspec-rails rails my-test-app cd my-test-app ruby script/generate rspec When i used 'rake spec' i received no error. After that I created a controller then installed the two plugin

Re: [rspec-users] rspec - undefined method `describe' for main:Object

2008-10-13 Thread Mano ah
Thank you Pat Maddox,Douglas Adams,Luis Lavena,Scott Taylor for your kind help. I have installed the plugins rspec and rspec-rails using git. I was not running the spec controller from the root thats the main problem. I followed all of your useful suggestions and able to build and run a proj

[rspec-users] How to test a controller

2008-10-16 Thread Mano ah
I want to test the controllers of an existing project. How can i do it. Actually when I use ruby script/spec rspec_scaffold modelname it creates a spec controller for that model and a controller inside the app folder. So for testing an already existing project how should i proceed. -- Posted vi

Re: [rspec-users] How to test a controller

2008-10-16 Thread Mano ah
Thank you stephen. Though it is easy to write spec for controller something stoped me like I am proceeding the wrong way. Your words gives confidence. so let me try and get back to you. -- Posted via http://www.ruby-forum.com/. ___ rspec-users maili

Re: [rspec-users] How to test a controller

2008-10-17 Thread Mano ah
Steph I sucessfully wrote my first test -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] how should i use response.should be sucess method pass

2008-10-19 Thread Mano ah
I want to test the basic controller test action and to make response.should be_sucess method work for it. How can i do -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo

[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

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 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 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-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-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 no

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