Re: [rspec-users] Stub an AR Model Instance Method

2011-06-11 Thread J. B. Rainsberger
On Thu, Jun 9, 2011 at 14:33, Karl wrote: > Obviously, I'm missing something very simple, can someone please > explain how to stub an instance of an AR model method. > > This does not work: > @widget = Widget.first # Widget has an instance method called > 'next_seriel_number' > @widget.stub(:next_

[rspec-users] subdomain based namespacing makes RSpec incorrectly state that the route doesn't exist

2011-06-11 Thread Daniel
Hello, I'm doing namespace routing based on subdomain, rather than path, so that http://admin.example.com/pages leads to app/controllers/admin/ pages_controller.rb. Cucumber is following this fine, but RSpec is complaining that the requested route doesn't exist even though "rake routes" shows the

[rspec-users] Stub an AR Model Instance Method

2011-06-11 Thread Karl
Obviously, I'm missing something very simple, can someone please explain how to stub an instance of an AR model method. This does not work: @widget = Widget.first # Widget has an instance method called 'next_seriel_number' @widget.stub(:next_serial_number).and_return(43, nil) I know I could use '