On Tue, Dec 30, 2008 at 4:17 PM, Jesse Crockett <[email protected]> wrote:
> Hello,
>
> I'm trying to get a positive attitude towards testing.
I think you already do just by virtue of this email.
> I wrote a
> controller that seems to work, and I want to make some tests. I
> populated the test db with an auction, some users, an item, and some
> charities. But, here is my first test, can't get it to pass. If you
> please, can you just help me get this test to pass, and not dwell on how
> wrong my approach is? I'll appreciate it, thanks.
>
> require File.dirname(__FILE__) + '/../spec_helper'
>
> describe "bidding on an item" do
> controller_name :items
> integrate_views
>
> before :each do
> @user = User.first
> User.stub!(:current_user).with(@user)
> end
>
> it "should require a credit" do
> @user.credits = 0
> @user.save
> post 'bid', :bid => {:auction_id => 1, :user_id => @user, :point =>
> 1}
> Bid.count.should == 0
> end
>
> end
What's the failure message?
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users