Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread David Chelimsky
On 8/24/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > On 8/24/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 8/24/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > > > On 8/24/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > > describe Widget, "class" do > > > > it "should provide a list of wi

Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread Pat Maddox
On 8/24/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/24/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > > On 8/24/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > describe Widget, "class" do > > > it "should provide a list of widgets sorted alphabetically" do > > > Widget.should_rece

Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread David Chelimsky
On 8/24/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > On 8/24/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > describe Widget, "class" do > > it "should provide a list of widgets sorted alphabetically" do > > Widget.should_receive(:find).with(:order => "name ASC") > > Widget.find_alphabe

Re: [rspec-users] Keeping unit tests from hitting the DB

2007-08-24 Thread Pat Maddox
On 8/24/07, Jim Deville <[EMAIL PROTECTED]> wrote: > > On Aug 23, 2007, at 9:48 PM, Pat Maddox wrote: > > > On 8/23/07, Jim Deville <[EMAIL PROTECTED]> wrote: > >> > >>> As far as model specs go...I've been toying with the idea of > >>> splitting > >>> up non-db-reliant behavior specs from the

Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread Pat Maddox
On 8/24/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > describe Widget, "class" do > it "should provide a list of widgets sorted alphabetically" do > Widget.should_receive(:find).with(:order => "name ASC") > Widget.find_alphabetically > end > end > > You're correct that the refactorin

Re: [rspec-users] Keeping unit tests from hitting the DB

2007-08-24 Thread David Chelimsky
On 8/24/07, Jim Deville <[EMAIL PROTECTED]> wrote: > > On Aug 23, 2007, at 9:48 PM, Pat Maddox wrote: > > > On 8/23/07, Jim Deville <[EMAIL PROTECTED]> wrote: > >> > >>> As far as model specs go...I've been toying with the idea of > >>> splitting > >>> up non-db-reliant behavior specs from the

Re: [rspec-users] Keeping unit tests from hitting the DB

2007-08-24 Thread Jim Deville
On Aug 23, 2007, at 9:48 PM, Pat Maddox wrote: > On 8/23/07, Jim Deville <[EMAIL PROTECTED]> wrote: >> >>> As far as model specs go...I've been toying with the idea of >>> splitting >>> up non-db-reliant behavior specs from the specs that do require the >>> database. When you want to speci

Re: [rspec-users] undefined method `mock_model' for [RSpec example]:#

2007-08-24 Thread Zach Dennis
On 8/20/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 8/20/07, Zach Dennis <[EMAIL PROTECTED]> wrote: > > On 8/20/07, aslak hellesoy <[EMAIL PROTECTED]> wrote: > > > Several problems here: > > > > > > First, rspec_scaffold must be given a *singularised* name, in your > > > case 'product'. (Th

Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread Zach Dennis
On 8/24/07, David Green <[EMAIL PROTECTED]> wrote: > > hypothetical question for all you BDD experts: > > I want to make sure that a :list action always returns widgets in > alphabetical order. There's at least 2 ways of doing this: > > > it "should fetch items in alphabetical order" do > Widget.

Re: [rspec-users] nuby: how spec redirect_to at ApplicationController

2007-08-24 Thread David Chelimsky
On 8/24/07, Priit Tamboom <[EMAIL PROTECTED]> wrote: > On 8/16/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > > > On 8/15/07, Courtenay <[EMAIL PROTECTED]> wrote: > > > On 8/15/07, Priit Tamboom <[EMAIL PROTECTED]> wrote: > > > > > > describe ApplicationController do > > > >it "method login

Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread David Chelimsky
On 8/24/07, David Green <[EMAIL PROTECTED]> wrote: > > hypothetical question for all you BDD experts: > > I want to make sure that a :list action always returns widgets in > alphabetical order. There's at least 2 ways of doing this: > > it "should fetch items in alphabetical order" do > Widget.sh

Re: [rspec-users] nuby: how spec redirect_to at ApplicationController

2007-08-24 Thread Priit Tamboom
On 8/16/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > > On 8/15/07, Courtenay <[EMAIL PROTECTED]> wrote: > > On 8/15/07, Priit Tamboom <[EMAIL PROTECTED]> wrote: > > > > describe ApplicationController do > > >it "method login_required should redirect to home path without > login" do > > > >

[rspec-users] testing behaviour or testing code?

2007-08-24 Thread David Green
hypothetical question for all you BDD experts: I want to make sure that a :list action always returns widgets in alphabetical order. There's at least 2 ways of doing this: it "should fetch items in alphabetical order" do Widget.should_receive(:find).with(:order => "name ASC") get :list end