Re: [rspec-users] undefined local variable or method

2013-08-02 Thread Guirec Corbel
Hello, I retried with the version 2.14. I have this spec : require 'spec_helper' describe OrdersController do #... describe "POST 'create'" do subject(:do_post!) { post 'create', params } context "when the order and the credit card and the payment are valid" do before do

Re: [rspec-users] undefined local variable or method

2013-06-11 Thread Guirec Corbel
I have the same problem with many other. Thanks for your help. Le 2013-06-11 17:02, Andy Lindeman a écrit : On Mon, Jun 10, 2013 at 9:16 PM, Guirec Corbel wrote: I am using rspec-rails 2.14.0.rc1 Can you give this a try with the latest 2.14 from rspec-core git? We fixed an issue with `let` d

Re: [rspec-users] undefined local variable or method

2013-06-11 Thread Andy Lindeman
On Mon, Jun 10, 2013 at 9:16 PM, Guirec Corbel wrote: > I am using rspec-rails 2.14.0.rc1 Can you give this a try with the latest 2.14 from rspec-core git? We fixed an issue with `let` definitions that I think might be related. That is, add this to Gemfile and run `bundle update rspec-core`: ge

Re: [rspec-users] undefined local variable or method

2013-06-10 Thread Guirec Corbel
I am using rspec-rails 2.14.0.rc1 ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] undefined local variable or method

2013-06-10 Thread Andy Lindeman
On Mon, Jun 10, 2013 at 6:45 PM, Guirec Corbel wrote: > Hi, > > I a controller spec like this : > https://gist.github.com/GCorbel/5753042#file-painting_controller_spec_1-rb. > (at the top). When I try to run this spec I have this message : > > Failure/Error: before { painting.stub(:valid?).an

[rspec-users] undefined local variable or method

2013-06-10 Thread Guirec Corbel
Hi, I a controller spec like this : https://gist.github.com/GCorbel/5753042#file-painting_controller_spec_1-rb. (at the top). When I try to run this spec I have this message : Failure/Error: before { painting.stub(:valid?).and_return(true) } NameError: undefined local variable or method ` pai

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-14 Thread Kristian Mandrup
Thanks again David :) Pure magic to me, I don't really understand how/ why that makes it work. But it does! On Jun 14, 2:30 am, David Chelimsky wrote: > On Jun 13, 2010, at 5:32 PM, Kristian Mandrup   > wrote: > > > > > shared_examples_for "a template that renders the messages/form > > partial"

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-13 Thread David Chelimsky
On Jun 13, 2010, at 5:32 PM, Kristian Mandrup wrote: shared_examples_for "a template that renders the messages/form partial" do it "renders the messages/form partial" do view.should_receive(:_render_partial). with(hash_including(:partial => "form")) render end end # new.html.erb

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-13 Thread Kristian Mandrup
shared_examples_for "a template that renders the messages/form partial" do it "renders the messages/form partial" do view.should_receive(:_render_partial). with(hash_including(:partial => "form")) render end end # new.html.erb <%= render "sidebar", :recent_messages => @recent_me

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-13 Thread Kristian Mandrup
Thanks! Just what I needed :) ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-13 Thread David Chelimsky
On Jun 13, 2010, at 4:35 PM, Kristian Mandrup wrote: > Hi David, > > Sounds great! Looking forward to more documentation :) > I have now gone through all the examples in the RSpec book and got > them working with the latest version of RSpec 2 and Rails 3 beta4. > I only have one loose end: > > s

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-13 Thread Kristian Mandrup
Hi David, Sounds great! Looking forward to more documentation :) I have now gone through all the examples in the RSpec book and got them working with the latest version of RSpec 2 and Rails 3 beta4. I only have one loose end: shared_examples_for "a template that renders the messages/form partial"

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-13 Thread David Chelimsky
On Jun 13, 2010, at 6:49 AM, Kristian Mandrup wrote: > assigns(:message).should eq(@message) > > assign(:message, stub("Message", :text => "Hello world!")) > > Hmm, so 'assign' to assign a variable and 'assigns' to read an > assigned variable? > We need to update the RSpec 2 wiki or somewhere wi

Re: [rspec-users] undefined local variable or method `assigns'

2010-06-13 Thread Kristian Mandrup
assigns(:message).should eq(@message) assign(:message, stub("Message", :text => "Hello world!")) Hmm, so 'assign' to assign a variable and 'assigns' to read an assigned variable? We need to update the RSpec 2 wiki or somewhere with all these API changes so it is clear to everyone. On Jun 11, 9:

[rspec-users] undefined local variable or method `assigns'

2010-06-11 Thread David Chelimsky
On Thu, Jun 10, 2010 at 4:41 PM, wrote: > I might be missing something basic here, but I'm stumped on this > error: > > model code: > > class CachedStat < ActiveRecord::Base >    def self.create_stats_days_ago(days_ago, human_id) >    d = Date.today - days_ago.day >   �...@prs = PageRequest.find(:

Re: [rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread theLemcke
Thanks a lot, that fixed it. Sorry about the double post, btw. On Sep 2, 3:03 pm, theLemcke wrote: > I ran this install > guide:http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-ra... > > Then generated a rails app, and ran 'script/generate rspec' and > 'script/generate rspec_m

[rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread theLemcke
I ran this install guide: http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition Then generated a rails app, and ran 'script/generate rspec' and 'script/generate rspec_model Note' When I try to spec note_spec.rb I get this error: /Users/sixt

Re: [rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread David Chelimsky
On Wed, Sep 2, 2009 at 5:22 PM, theLemcke wrote: > So I began with this setup: > http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition > > Created a basic rails setup, ran 'script/generate rspec' and 'script/ > generate rspec_model Note' and t

[rspec-users] undefined local variable or method `__FILE'

2009-09-02 Thread theLemcke
So I began with this setup: http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition Created a basic rails setup, ran 'script/generate rspec' and 'script/ generate rspec_model Note' and tried to run 'note_spec.rb' and I encountered this error:

Re: [rspec-users] undefined local variable or method `params' for #

2009-06-08 Thread David Chelimsky
On Mon, Jun 8, 2009 at 12:21 AM, Salil Gaikwad wrote: > Hi All, > > Any Update on this topic. > > I still not found any solution for a following method. > >  it "should be active if controller is same" do >    tab_class('tab').should include('active') >  end Please read http://wiki.github.com/dche

Re: [rspec-users] undefined local variable or method `params' for #

2009-06-07 Thread Salil Gaikwad
Hi All, Any Update on this topic. I still not found any solution for a following method. it "should be active if controller is same" do tab_class('tab').should include('active') end Regards, Salil -- Posted via http://www.ruby-forum.com/. __

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Chris Flipse
helper.stub! the OP is testing a helper method. On Tue, Apr 14, 2009 at 9:04 AM, Fernando Perez wrote: > Try with that: > > controller.stub!(:params).and_return({:controller => > 'your_controller_name'}) > -- > Posted via http://www.ruby-forum.com/. >

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Salil Gaikwad
> Try with that: > > controller.stub!(:params).and_return({:controller => > 'your_controller_name'}) Nah it doesn't work out,gives same error. neways thanx for the info. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-user

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Fernando Perez
> it "should be active if controller is same" do > params = {:controller => 'royalty_statement'} > tab_class('royalty_statement').should include('active') > end > > but it doesn't work out. it gives me same error as previous. Nah it doesn't work that way, because remember that RSpec is

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Fernando Perez
Try with that: controller.stub!(:params).and_return({:controller => 'your_controller_name'}) -- 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 local variable or method `params' for #

2009-04-14 Thread Salil Gaikwad
Fernando Perez wrote: >> it gives me following error >> >> undefined local variable or method `params' for > > That's normal. Remember that params exists because there is an http > request issued. In your spec, you don't tell Rspec anything about any > request. So you could create a mock for pa

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-14 Thread Fernando Perez
> it gives me following error > > undefined local variable or method `params' for That's normal. Remember that params exists because there is an http request issued. In your spec, you don't tell Rspec anything about any request. So you could create a mock for params. If I recall correctly you

Re: [rspec-users] undefined local variable or method `params' for #

2009-04-13 Thread aslak hellesoy
On Tue, Apr 14, 2009 at 8:24 AM, Salil Gaikwad wrote: > following is the method of the helper > > module ApplicationHelper > def tab_class(tab) >'class="active"' if tab == params[:controller] > end > end > > i write the spec method as follows > > describe ApplicationHelper do > it "should

[rspec-users] undefined local variable or method `params' for #

2009-04-13 Thread Salil Gaikwad
following is the method of the helper module ApplicationHelper def tab_class(tab) 'class="active"' if tab == params[:controller] end end i write the spec method as follows describe ApplicationHelper do it "should be active if controller is same" do tab_class('royalty_statement').s