[rspec-users] My first tests, backwards. Please help

Jesse Crockett lists at ruby-forum.com
Tue Dec 30 17:41:50 EST 2008

David Chelimsky wrote:
> On Tue, Dec 30, 2008 at 4:17 PM, Jesse Crockett <lists at 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 

I'm so confused..  this one is the most confusing.

  it "should require a credit" do
    @user.credits = 0
    post 'bid', :bid => {:auction_id => 1, :user_id => @user, :point => 
    assigns[:bid].should_not be_new_record
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/.

More information about the rspec-users mailing list