[rspec-users] problem running rspec test with Webrat

2011-03-08 Thread Amit Kulkarni
Hi, I am trying to run rspec testcase using webrat but it is showing me an error as "undefined method `last_response' for #" Following are my configurations: Gemfile: roup :development, :test do gem 'sqlite3-ruby', :require => 'sqlite3' gem "rspec", "=2.4.0" gem "rspec-rails", "2.4.0" #

[rspec-users] Writing Rspec for signup using facebook

2011-03-01 Thread Amit Kulkarni
Hi, We are using omniauth for signup through Facebook and twitter. Is there any way i can check this by rspec controllers since it contains callbacks n all..so i think we may have to use mock models. If there is any link or documentation please let me know so that i can start implementing. -- Pos

[rspec-users] Preloading of data in rspec2

2011-01-13 Thread Amit Kulkarni
Hello, I had used Fixtures and factory girl for preloading of data in earlier version rspec. Is there any new thing for loading of data in rspec 2 or do we have to use the same. Also is there any documentation link where i can get nice info about rspec 2 -- Posted via http://www.ruby-forum.com/.

Re: [rspec-users] Results in rspec 2.4.0

2011-01-13 Thread Amit Kulkarni
Hey, Thanks a lot for the presentation.It was really helpful. -- 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] Installing rspec 2 for Rails 3

2011-01-12 Thread Amit Kulkarni
Thanks a lot.Will look into it. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Installing rspec 2 for Rails 3

2011-01-12 Thread Amit Kulkarni
Hi, I have successfully installed rspec 2 for Rails 3 by visiting the following link http://lindsaar.net/2010/4/14/installing_rspec_for_rails_3 In this post it is mentioned taht when i do "rails g rspec:install" then it should install exist lib create lib/tasks/rspec.rake exist con

[rspec-users] Results in rspec 2.4.0

2011-01-12 Thread Amit Kulkarni
Hi, I am running rspec spec for Rails 3.The version for rspec is 2.4.0 When running the script i am getting output as User Profile should not be created if name is blank Failure/Error: @contact_detail.should be_valid expected valid? to return true, got false # ./spec/models/merchan

Re: [rspec-users] Testing Email thriugh Rspec

2010-08-19 Thread Amit Kulkarni
Ok.I will post this topic separately.. :) -- 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 Email thriugh Rspec

2010-08-19 Thread Amit Kulkarni
David Chelimsky wrote: > On Aug 19, 2010, at 8:57 AM, Amit Kulkarni wrote: > >> Amit Kulkarni wrote: >>> For the application i have written scripts which i am call from a rake >>> task. >>> So i need to know whether how much tests have been passed/failed b

Re: [rspec-users] Load dummy data using Factory girl

2010-08-19 Thread Amit Kulkarni
David Chelimsky wrote: > On Aug 18, 2010, at 10:46 AM, Amit Kulkarni wrote: > >> Amit Kulkarni wrote: >>> Hello, >>> I wanted to know how to load dummy data in the application using Factory >>> girl. >>> I had done this using Fixtures.I had made a

Re: [rspec-users] Testing Email thriugh Rspec

2010-08-19 Thread Amit Kulkarni
Amit Kulkarni wrote: > For the application i have written scripts which i am call from a rake > task. > So i need to know whether how much tests have been passed/failed by > email. In the mail i will get the count of total tests passed/failed. -- Posted via http://www.ru

Re: [rspec-users] Testing Email thriugh Rspec

2010-08-18 Thread Amit Kulkarni
For the application i have written scripts which i am call from a rake task. So i need to know whether how much tests have been passed/failed by email. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org htt

Re: [rspec-users] Load dummy data using Factory girl

2010-08-18 Thread Amit Kulkarni
Amit Kulkarni wrote: > Hello, > I wanted to know how to load dummy data in the application using Factory > girl. > I had done this using Fixtures.I had made a fixtures folder into the > test folder and run the command "rake test fixtures:load" > Currently i tried using

Re: [rspec-users] Testing Email thriugh Rspec

2010-08-18 Thread Amit Kulkarni
jko170 wrote: > There is also the excellent email_spec gem: > > http://github.com/bmabey/email-spec/ Continuing with the topic but scenario is different: I had written a rake task in rspec.rake.What i want is after running the task i should get an email So for that i have created a method in app

[rspec-users] Load dummy data using Factory girl

2010-08-16 Thread Amit Kulkarni
Hello, I wanted to know how to load dummy data in the application using Factory girl. I had done this using Fixtures.I had made a fixtures folder into the test folder and run the command "rake test fixtures:load" Currently i tried using factories in the spec which is working fine. Wanted to know kn

Re: [rspec-users] Rspec model generation problem

2010-05-07 Thread Amit Kulkarni
Amit Kulkarni wrote: > Hello, > I am currently working on Ubuntu machine in which there is already a > spec file generated which has some models > So i just updated by entering the command "ruby script/generate rspec" > Now when i try to generate rspec model then it show

[rspec-users] Rspec model generation problem

2010-05-07 Thread Amit Kulkarni
Hello, I am currently working on Ubuntu machine in which there is already a spec file generated which has some models So i just updated by entering the command "ruby script/generate rspec" Now when i try to generate rspec model then it shows error as "The name 'User' is either already used in your

[rspec-users] Rspec model generate problem

2010-05-07 Thread Amit Kulkarni
Hello, I am currently working on Ubuntu machine in which there is already a spec file generated which has some models So i just updated by entering the command "ruby script/generate rspec" Now when i try to generate rspec model then it shows error as "The name 'User' is either already used in your

[rspec-users] Cucumber login problem

2010-04-29 Thread Amit Kulkarni
Hello all, I am facing a weird problem.I am just trying to login but after entering correct parameters it is showing error as invalid username and password. I think there is some configuration or fixtures problem because if i try to login from GUI then it is working fine(using same database) Follow

Re: [rspec-users] webrat methods are undefined

2010-03-10 Thread Amit Kulkarni
Hello, I recently updated rspec-rails from 1.1.12 to 1.3.0 and rspec from 1.1.12 to 1.3.0 Now while running cucumber i am facing a problem. It says as 'undefined method 'visit'' my cucumber version is 0.3.99 and webrat version is 0.7.0. Before upgrading the gem it ran well but now above error is

Re: [rspec-users] Undefined method 'post'

2010-03-08 Thread Amit Kulkarni
Hello, I am having some problem with the controllers after i updated my specs. Following are the details: I am trying to call create action as post :create :user => {:name => "abc", :login => "abcd", :phone => 1} After this i am searching this for confirmation i.e. user = User.find_by_name("ab

Re: [rspec-users] Undefined method 'post'

2010-03-08 Thread Amit Kulkarni
Amit Kulkarni wrote: > David Chelimsky wrote: >> On Mon, Mar 8, 2010 at 1:13 AM, Amit Kulkarni >> wrote: >>> As per the list there are 3 versions of rspec released in Jan 2010 i.e. >>> 1.3.0,1.3.1 and 1.3.2 >>> Also there are various versions starting f

Re: [rspec-users] Undefined method 'post'

2010-03-08 Thread Amit Kulkarni
David Chelimsky wrote: > On Mon, Mar 8, 2010 at 1:13 AM, Amit Kulkarni > wrote: >> As per the list there are 3 versions of rspec released in Jan 2010 i.e. >> 1.3.0,1.3.1 and 1.3.2 >> Also there are various versions starting from 2. >> So from all above version which

Re: [rspec-users] Undefined method 'post'

2010-03-07 Thread Amit Kulkarni
As per the list there are 3 versions of rspec released in Jan 2010 i.e. 1.3.0,1.3.1 and 1.3.2 Also there are various versions starting from 2. So from all above version which one is a stable one so that i can install it. -- Posted via http://www.ruby-forum.com/. _

Re: [rspec-users] Undefined method 'post'

2010-03-05 Thread Amit Kulkarni
Amit Kulkarni wrote: > Hello all, > I am facing a strange problem. > I have generated rspec for a particular project.Similarly created a spec > controller.Under that controller i have written post :create action > When i run my spec i get an error as > "unde

[rspec-users] Undefined method 'post'

2010-03-04 Thread Amit Kulkarni
Hello all, I am facing a strange problem. I have generated rspec for a particular project.Similarly created a spec controller.Under that controller i have written post :create action When i run my spec i get an error as "undefined method `post' for #" Strangely my models are working fine.My rails

Re: [rspec-users] testing controllers using cucumber

2010-02-01 Thread Amit Kulkarni
Oh ok. >From your code it seems that we are checking the whole app as you mentioned. I have tested controllers using rspec. So i am not getting which is better to use. Since with Rspec we test the objects and here using cucumber(good for writing scenarios and understanding)we are testing the GUI

[rspec-users] testing controllers using cucumber

2010-01-29 Thread Amit Kulkarni
Hello, Is there any way to test controllers using cucumber. I was doing it with rspec but since cucumber's description is good how can i proceed testing it with cucumber? For e.g. I have a scenario of user creation like Feature: User Scenarios Scenario: Successfull creation of user Given a n

Re: [rspec-users] Testing Email thriugh Rspec

2010-01-22 Thread Amit Kulkarni
Hello all, I got my problem solved.It was really a simple mistake. I have a doubt that in development i can send a mail but in while testing(through Rspec) mail is not getting sent. Do i need to change some configuration for testing? -- Posted via http://www.ruby-forum.com/. _

Re: [rspec-users] Testing Email thriugh Rspec

2010-01-22 Thread Amit Kulkarni
I got the Notifier model included in the user spec like require 'notifier.rb' By adding this i can now access Notifier.deliver_signup_notification method(i checked up in the code and it user deliver before that) Now i can access the method. But another problem is i am getting error as "undefined

[rspec-users] Testing Email thriugh Rspec

2010-01-21 Thread Amit Kulkarni
Hi i am testing email through rspec but some problem occured. This is the whole scenario: What i want to do is when my user is created it should send mail to for activation. This is the code under user_spec.rb require File.expand_path(File.dirname(__FILE__) + ‘/../spec_helper’) def valid_user_attr

Re: [rspec-users] Display Rspec output in an html file

2010-01-20 Thread Amit Kulkarni
Thanks a lot David. I generated a the output to xls with the command "spec user_spec.rb --format progress:a.xls" Under the xls it is displaying only those examples which are failing like for e.g. 1) 'User User should not be created if email format is different' FAILED expected: "Please check the

Re: [rspec-users] Display Rspec output in an html file

2010-01-20 Thread Amit Kulkarni
Amit Kulkarni wrote: > Ok.Thanks a lot David Hello, Is there any way to display rspec result in .csv or .xls format. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listi

Re: [rspec-users] Troubles with route_for

2010-01-10 Thread Amit Kulkarni
Nick Hoffman wrote: > Hey guys. I'm having some trouble with a route spec. In routes.rb , I > have: > map.connect 'foods/search/:name', :controller => :foods, :action => > :search > > foods_controller_spec.rb has: http://codepad.org/dg3FERKw > Unfortunately, that fails: http://codepad.org/lck4

Re: [rspec-users] Display Rspec output in an html file

2009-12-24 Thread Amit Kulkarni
Ok.Thanks a lot David -- 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] undefined method `route_for

2009-12-24 Thread Amit Kulkarni
Yes,Thanks a lot Andrew. The last two lines were not commented in routes.rb because of that it was matching default.Now i commented out those line and it was catching if undefined routes are given. -- Posted via http://www.ruby-forum.com/. ___ rspec-use

Re: [rspec-users] Problem with Before Filters

2009-12-24 Thread Amit Kulkarni
Thanks a lot David. I am now getting familiar with before filters. I am writing spec without using mocks so i need to just pass the proper parameter to get pass the filter. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-use

Re: [rspec-users] undefined method `route_for

2009-12-13 Thread Amit Kulkarni
Thanks David. Also i am little bit confused regarding routes. Consider a routing example it "should map { :controller => 'channels', :action => 'new' } to /channels/new" do route_for(:controller => "channels", :action => "new").should == "/channels/new" end Now i can see all the routing meth

Re: [rspec-users] Problem with Before Filters

2009-12-13 Thread Amit Kulkarni
Thanks David, Now in spec when i write login_as :admin then there must be some method written for login_as? Now if there are before filters in controller then do we need to write each and every method or it is indeed taken care of but the developer and we need to just have to pass the value for

[rspec-users] Problem with Before Filters

2009-12-09 Thread Amit Kulkarni
Hello, I am writing controller specs.I want to know how can i write specs which invlove before filters in controllers. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/

Re: [rspec-users] undefined method `route_for

2009-12-07 Thread Amit Kulkarni
Hi David, I have some query regarding running spec command. When i tried to run normal testcase by command "spec test_controller_spec.rb" then that particular test case runs but the routing testcase fails. Now if i run through the command "spec spec/controllers/test_controller_spec.rb" then all

Re: [rspec-users] Display Rspec output in an html file

2009-11-27 Thread Amit Kulkarni
Amit Kulkarni wrote: > Any suggestions on the above topic Hello, I want to print my output in an html file. I am using command rake spec:controllers --format html:result.html from the root directory But it is not working. Please suggest -- Posted via http://www.ruby-forum.

Re: [rspec-users] undefined method `route_for

2009-11-25 Thread Amit Kulkarni
Amit Kulkarni wrote: > Ok Fine.That sounds to be a good idea. > Thanks Hi David, Good news,My routing scenarios are working now. I dont know how but it did.I was going to mail you the app but it is working fine now. -- Posted via http://www.ruby-for

Re: [rspec-users] undefined method `route_for

2009-11-17 Thread Amit Kulkarni
Ok Fine.That sounds to be a good idea. Thanks -- 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] undefined method `route_for

2009-11-17 Thread Amit Kulkarni
Amit Kulkarni wrote: > Oh that means if i am using rails version 2.1.2 or more then i need to > have rspec version 1.1.12. > In that case i need to remove the latest version and install rspec > 1.1.12. > I will do it and update you asap. > Thanks a lot David. Hi David, As per

Re: [rspec-users] undefined method `route_for

2009-11-15 Thread Amit Kulkarni
Oh that means if i am using rails version 2.1.2 or more then i need to have rspec version 1.1.12. In that case i need to remove the latest version and install rspec 1.1.12. I will do it and update you asap. Thanks a lot David. -- Posted via http://www.ruby-forum.com/. ___

Re: [rspec-users] undefined method `route_for

2009-11-13 Thread Amit Kulkarni
MY spec helper contains following code: # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. ENV["RAILS_ENV"] ||= 'test' require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment')) require 'spec' require 'webrat'

Re: [rspec-users] undefined method `route_for

2009-11-12 Thread Amit Kulkarni
David Chelimsky wrote: > On Wed, Nov 11, 2009 at 11:19 PM, Amit Kulkarni > wrote: > >> >> >> It gets executed but i am not able to see any results as in 2 examples 2 >> passed something like that as it comes normally. >> > > Then how do you know

Re: [rspec-users] undefined method `route_for

2009-11-11 Thread Amit Kulkarni
David Chelimsky wrote: > On Nov 11, 2009, at 5:58 AM, Amit Kulkarni wrote: > >> >>it "should map { :controller => 'home' } RESTfully" do >> params_from( :get, '/home' ).should == { :controller => 'home', &

Re: [rspec-users] Display Rspec output in an html file

2009-11-11 Thread Amit Kulkarni
Any suggestions on the above topic -- 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] undefined method `route_for

2009-11-11 Thread Amit Kulkarni
Hi David still no success. require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe HomeController, "routes" do describe "route generation" do it "should map { :controller => 'home', :action => 'index' } to /home" do route_for(:controller => 'home', :action => 'index

Re: [rspec-users] undefined method `route_for

2009-11-11 Thread Amit Kulkarni
Thanks David for the information but still i am getting the same error. What i have done is: I have home controller. now i am writing route scenarios in home_controller_spec.rb which is under spec/controllers directory I tried your code which looks like as describe "route generation", :type => :

[rspec-users] undefined method `route_for

2009-11-10 Thread Amit Kulkarni
Hi all, I am writing scenarios for testing my routes but it is giving me error as undefined method `route_for and also for params_from. Did i miss something which i need to add in my controller My code is as follows: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe H

Re: [rspec-users] Display Rspec output in an html file

2009-11-10 Thread Amit Kulkarni
I checked the whole code but there is no error as such. What i have done is i added a line i.e. t.spec_opts = ['--format' , 'html:result.html' ] under /lib/tasks/rspec.rake i.e. [:models, :controllers, :views, :helpers, :lib, :integration].each do |sub| desc "Run the code examples in spec/#{s

Re: [rspec-users] Display Rspec output in an html file

2009-11-09 Thread Amit Kulkarni
Yes i get an error message as rake aborted. spec/models/survey_spec.rb" --format html:result.html failed -- 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] Display Rspec output in an html file

2009-11-09 Thread Amit Kulkarni
My spec.opts file contains --colour --format html:spec/a.html --loadby mtime --reverse -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Display Rspec output in an html file

2009-11-09 Thread Amit Kulkarni
Hello, I had written some model scenarios. Now i want to generate that output in an html file. i am executing the models using rake i.e. rake spec:models from spec directory. But the html file is not getting generated. Following is the error trace: ** Invoke spec:models (first_time) ** Invoke db:t

[rspec-users] Problem with before filters

2009-11-02 Thread Amit Kulkarni
Following is the scenario. describe BbPostsController, "POST Create" do context "Admin" do fixtures :users, :bb_posts, :user_channels, :channels, :channel_features it "should save post" do login_as(:amit) # Added to pass before filters in controller controller.s

[rspec-users] problem with should_receive in controller spec

2009-10-29 Thread Amit Kulkarni
I am trying to write controller spec but i am getting some problem. Following is the controller code: def create @bb_post = @feature.posts.new( params[ :bb_post ] ) if @bb_post.save flash[ :notice ] = 'Blog post was successfully created.' format.html { redirect_to( blog_bb_p

Re: [rspec-users] Troble running controller spec

2009-10-28 Thread Amit Kulkarni
Hello, Any updates on the above topic -- 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] Writing controller spec

2009-10-28 Thread Amit Kulkarni
Carlos Souza wrote: > Amit, > > Your controller spec that you said was working was not actually testing > your > controller since you were not calling any of your controller methods. Ok.In that case can you suggest how to call controller methods from the uppermost code which is running fine an

[rspec-users] Writing controller spec

2009-10-27 Thread Amit Kulkarni
Hello everybody, I had written same scenario using normal code which is as follows : def valid_attributes { :body => "test_description", :title => "test123", } end describe BbPostsController, "POST Create" do before(:each) do @post = BbPost.new end context "Admin" do fixt

Re: [rspec-users] Mock and Stub objects

2009-06-12 Thread Amit Kulkarni
Even if we are using mocks and if our models are changed then also we need to change our spec. Same for if we don't use mocks. So same question i am asking Are mocks really useful? Also When to use if at all we want to use? I searched on net regarding the same but till now no success :-) Also i

Re: [rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread Amit Kulkarni
> describe BbPostsController do > context "test" do > fixtures :bb_posts, :users > it "should create post" do > User.find_by_login("amit").should_not be_nil > post = create_post > post.should be_valid > end > end > end > > (that's an odd spec but let's try to get

Re: [rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread Amit Kulkarni
David Chelimsky wrote: > On Thu, Jun 11, 2009 at 11:50 AM, Amit Kulkarni > wrote: >> � require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') >> � �if @user >> �id: 1 >> amit: >> I dont know what is wrong. >> Please suggest :-) &g

[rspec-users] Fixtures are not loaded while running controller spec

2009-06-11 Thread Amit Kulkarni
Hi, I am running controller spec and it gives me result as 0 examples, 0 failures. I checked into the database and i saw that fixtures are not loaded. Following are the details of my controller file. require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') def valid_bb_

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Amit Kulkarni
Matt Wynne wrote: > On 11 Jun 2009, at 08:17, Amit Kulkarni wrote: > >>>> >> those objects. >> it >> be fine? > > If you're writing the specs after you've written the code, you're > losing a lot of the value of mock objects. Actua

Re: [rspec-users] Mock and Stub objects

2009-06-11 Thread Amit Kulkarni
David Chelimsky wrote: > On Wed, Jun 10, 2009 at 5:55 AM, Amit Kulkarni > wrote: >> Hello, >> >> � � �I had seen many controller spec using mock and stub objects. >> >> � � �I had written controller spec earlier without these objects. >> >> �

Re: [rspec-users] Troble running controller spec

2009-06-10 Thread Amit Kulkarni
Mohit Sindhwani wrote: > David Chelimsky wrote: >> Any Vista users in earshot? I've done all I can do on this. > Hi David > > I'm on Vista, but I just joined the mailing list - could I have a bit of > a background to what we're trying to do? I'll try to see what I can do. > > Cheers, > Mohi

[rspec-users] Mock and Stub objects

2009-06-10 Thread Amit Kulkarni
Hello, I had seen many controller spec using mock and stub objects. I had written controller spec earlier without these objects. In the book it is mention about mock and stub objects.but i am still not getting the reason behind it. Can somebody tell me what are these and

Re: [rspec-users] Troble running controller spec

2009-06-09 Thread Amit Kulkarni
David Chelimsky wrote: > On Tue, Jun 9, 2009 at 1:19 AM, Amit Kulkarni > wrote: >>> >>>> FYI - I get the same result from 1.2.6. All specs pass. >> >> Any Updates >> :-) > > Any Vista users in earshot? I've done all I can do o

Re: [rspec-users] Troble running controller spec

2009-06-08 Thread Amit Kulkarni
Amit Kulkarni wrote: >> You stated above that you were using 1.2.4, but now you are saying you >> are using 1.2.6. Please be sure to provide accurate information. > > I am sorry for the above information.Yes earlier the version was 1.2.4 > but i installed rspec again and it

Re: [rspec-users] Troble running controller spec

2009-06-08 Thread Amit Kulkarni
> You stated above that you were using 1.2.4, but now you are saying you > are using 1.2.6. Please be sure to provide accurate information. I am sorry for the above information.Yes earlier the version was 1.2.4 but i installed rspec again and it installed the latest version i.e 1.2.6 > Do you hav

Re: [rspec-users] Troble running controller spec

2009-06-08 Thread Amit Kulkarni
David Chelimsky wrote: > On Mon, Jun 8, 2009 at 8:31 AM, Amit Kulkarni > wrote: >>> I *think* Rails converts the keys in this hash to strings. Try: >> >> Channel.should_receive(:new).with('brand_name' => 'manager' >> ).and_return(

Re: [rspec-users] Troble running controller spec

2009-06-08 Thread Amit Kulkarni
David Chelimsky wrote: > On Fri, May 22, 2009 at 1:41 AM, Amit Kulkarni > wrote: >> >> � end >> >> � it "should create channel" do >> � �Channel.should_receive(:new).with(:brand_name => "test" >> ).and_return(@channel) &g

[rspec-users] Troble running controller spec

2009-05-22 Thread Amit Kulkarni
Hi, I am trying to execute controller spec by referring to RSpec book but it is diving me error. Following are the details: Ruby version : 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] rspec - 1.2.4 rails - 2.1.2 OS - Vista Home My channels_controller_spec.rb(which is under rootproject/spec

Re: [rspec-users] Error in executing controller spec

2009-05-21 Thread Amit Kulkarni
David Chelimsky wrote: > On Wed, May 20, 2009 at 2:47 AM, Amit Kulkarni > wrote: >>>> It is not the case that i will always run spec from the root project.So >> Thank a lot. >> But is the case that all controller specs are run from the root >> directory. >

Re: [rspec-users] Error in executing controller spec

2009-05-20 Thread Amit Kulkarni
David Chelimsky wrote: > On Wed, May 20, 2009 at 1:47 AM, Amit Kulkarni > wrote: >>>> script/spec spec/controllers/channels_controller_spec1.rb >>> >>> Hey It worked thanks a lot. :-) >>> >>> Can you tell me the difference why it was not

Re: [rspec-users] Error in executing controller spec

2009-05-20 Thread Amit Kulkarni
David Chelimsky wrote: > On Tue, May 19, 2009 at 9:04 AM, Amit Kulkarni > wrote: >> but i am getting the same error which says RuntimeError in >> Files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_control >> ./channels_controller_spec1.rb:149: > It looks l

Re: [rspec-users] Error in executing controller spec

2009-05-20 Thread Amit Kulkarni
Amit Kulkarni wrote: > David Chelimsky wrote: >> On Tue, May 19, 2009 at 9:04 AM, Amit Kulkarni >> wrote: >>> but i am getting the same error which says RuntimeError in >>> Files/ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.2/lib/action_control >>> ./cha

Re: [rspec-users] Error in executing controller spec

2009-05-19 Thread Amit Kulkarni
Hi, Thanks for quick response My channels_controller_spec.rb file is inside controller spec only i.e. PROJECT_ROOT/spec/controllers/channels_controller_spec.rb. As per your suggestion i removed the setup method and moved user_attributes under example groups. but i am getting the same error whi

Re: [rspec-users] Error in executing controller spec

2009-05-19 Thread Amit Kulkarni
Ruby version : 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32] rspec - 1.2.4 rails - 2.1.2 OS - Vista Home I am running a single file by the command spec channels_controller(filename)_spec.rb Contents of the file: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') def setup @c

[rspec-users] Error in executing controller spec

2009-05-08 Thread Amit Kulkarni
Hello, I am trying to execute controller spec but it gives me error which says @controller is nil: make sure you set it in your test's setup method. I tried to search for the solution but till now no success :( Following is the description of the controller spec. describe ChannelCate