David Chelimsky wrote: > On Tue, Dec 30, 2008 at 4:17 PM, Jesse Crockett <li...@ruby-forum.com> > wrote: >> Hello, >> >> I'm trying to get a positive attitude towards testing. > > I think you already do just by virtue of this email.
No comment :-) > > What's the failure message? I'm confused, because I don't know if the stub is returning the logged_in? @current_user (bort base app) and doing something I'm not sure what. However, I mainly get "You may be expecting an instance of ActiveRecord::Base. I'm so confused.. this one is the most confusing. it "should require a credit" do @user.credits = 0 @user.save post 'bid', :bid => {:auction_id => 1, :user_id => @user, :point => 1} assigns[:bid].should_not be_new_record end === You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.new_record? === But the model and views are all written. The bid method is fairly complex. This is the simplest test case I can think of. -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users