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(: