Re: [rspec-users] Rspec 2, Rails 3 and Webrat

2010-06-13 Thread David Chelimsky
On Jun 11, 2010, at 10:17 PM, Rodrigo Rosenfeld Rosas wrote: > Apparently Webrat is not yet compatible with Rails 3: This is incorrect. It's just that webrat needs to be configured for :rack instead of :rails: Webrat.configure do |config| config.mode = :rack end Since you'r

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

[rspec-users] Recommendations for ticket #971 workaround?

2010-06-13 Thread John Feminella
hello, I'm running rspec 1.3.0 on Ruby 1.9.2-dev. It appears that when you use `it` without a corresponding block, the test case is treated not as pending, but instead throws an error inside rspec. I see that there is a bug to this effect filed here: https://rspec.lighthouseapp.com/projects/5645/t

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] Method stub return values for message expectations

2010-06-13 Thread David Chelimsky
On Jun 13, 2010, at 4:15 PM, Tom Stuart wrote: > Hi, > > RSpec has long had the ability to set a message expectation for a stubbed > method without disrupting its (stubbed) return value. This is really helpful > for a variety of reasons, not least because it decouples the stubbed method's > re

[rspec-users] Method stub return values for message expectations

2010-06-13 Thread Tom Stuart
Hi, RSpec has long had the ability to set a message expectation for a stubbed method without disrupting its (stubbed) return value. This is really helpful for a variety of reasons, not least because it decouples the stubbed method's return value from the expectation that the method will be call

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] RSpec 2: uninitialized constant - mocking belongs_to AR relation

2010-06-13 Thread Kristian Mandrup
Cause of error: class Message < ActiveRecord::Base belongs_to :recipient #, :class_name => User.name -- it then by convention expects there to be a model class called Recipient. should instead be class Message < ActiveRecord::Base belongs_to :recipient, :class_name => User.name But then the

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: