[rspec-users] How do I stub a view in rspec-2

2010-06-08 Thread Trey Bean
Hi, I'm in the process of upgrading an app to Rails 3/Rspec 2. I see that stubbing a view helper method has changed in Rspec 2. It looks like instead of doing template.stub!, we're now supposed to do view.stub!, but I can't seem to get this to work on beta 10. I get an "undefined local variable

[rspec-users] How do I stub a view in rspec-2

2010-06-08 Thread Trey Bean
Hi, I'm in the process of upgrading an app to Rails 3/Rspec 2. I see that stubbing a view helper method has changed in Rspec 2. It looks like instead of doing template.stub!, we're now supposed to do view.stub!, but I can't seem to get this to work on beta 10. I get an "undefined local variable

Re: [rspec-users] How do I stub a view in rspec-2

2010-06-08 Thread Trey Bean
Thanks David! On Tue, Jun 8, 2010 at 10:41 AM, dchelim...@gmail.com wrote: > > > On Jun 8, 12:15 pm, David Chelimsky wrote: > > On Jun 8, 2010, at 10:26 AM, Trey Bean wrote: > > > > > > > > > > > > > Hi, > > > > > I

Re: [rspec-users] How do I stub a view in rspec-2

2010-06-09 Thread Trey Bean
I've been using edge since your commit (and rails 3 beta 4) and it's working great. Thanks! On Wed, Jun 9, 2010 at 6:56 AM, David Chelimsky wrote: > On Sat, Jun 5, 2010 at 8:24 PM, Trey wrote: > > Hi, > > > > I'm in the process of upgrading an app to Rails 3/Rspec 2. I see that > > stubbing a

Re: [rspec-users] assigns in RSpec 2 - deprecation warning on rendered?

2010-06-09 Thread Trey Bean
Hi Kristian, The new rspec 2 way of doing assigns is assign(variable_name, whats_being_assigned). So your example becomes: assign(:message, stub("Message")) That should get rid of your deprecation message. Cheers, Trey On Wed, Jun 9, 2010 at 10:56 AM, Kristian Mandrup wrote: > I have come to

Re: [rspec-users] assigns in RSpec 2 - deprecation warning on rendered?

2010-06-09 Thread Trey Bean
If you want to use your assigned message within your spec, you can assign it to a variable in the assign call, e.g. assign(:message, @message = stub('message'). Since you're calling text on the message in your view, you should stub that method: assign(:message, @message = stub('message', :text =

Re: [rspec-users] Undefined method respont_to - rspec

2010-06-14 Thread Trey Bean
It looks like you need to put those lines in an it block. it 'should...' do token... end Trey On Jun 14, 2010, at 1:05 PM, Marcelo de Moraes Serpa wrote: > Hello list, > > I have this very simple model spec: > > require 'spec_helper' > > describe Token do > describe "Associations" do >