Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Pat Maddox
Neil Cauldwell <[EMAIL PROTECTED]> writes: > Pat Maddox wrote: >> Neil Cauldwell <[EMAIL PROTECTED]> writes: >> > ...so shouldn't the spec fail if we're returning all the users fixtures which is true. [1,2,3] is not an element of the array [1,2,3]. I used >>> description); >>> results

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Neil Cauldwell
Pat Maddox wrote: > Neil Cauldwell <[EMAIL PROTECTED]> writes: > ...so shouldn't the spec fail if we're returning all the users fixtures >>> which is true. [1,2,3] is not an element of the array [1,2,3]. I used >> description); >> results >> ...so I'm one step closer but I'm now a little c

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Pat Maddox
Neil Cauldwell <[EMAIL PROTECTED]> writes: > Pat Maddox wrote: >> Neil Cauldwell <[EMAIL PROTECTED]> writes: >> >>> (which it doesn't, therefore suggesting the spec is broken); >>>def do_get >>> ThinkingSphinx::Search.stub!(:search).and_return(users) >>> get :people, :search =

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Neil Cauldwell
Pat Maddox wrote: > Neil Cauldwell <[EMAIL PROTECTED]> writes: > >>> >> (which it doesn't, therefore suggesting the spec is broken); >>def do_get >> ThinkingSphinx::Search.stub!(:search).and_return(users) >> get :people, :search => "bob" >>end >> >> ...so shouldn't the spec fail

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Pat Maddox
Neil Cauldwell <[EMAIL PROTECTED]> writes: > Pat Maddox wrote: >> Neil Cauldwell <[EMAIL PROTECTED]> writes: >>> >>> respond_to do |format| >>> format.html >>> format.xml { render :xml => @results } >>> end >>> end >>> >>> Cheers >> >> You're stubbing User.search, but you d

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Neil Cauldwell
Pat Maddox wrote: > Neil Cauldwell <[EMAIL PROTECTED]> writes: >> >> respond_to do |format| >> format.html >> format.xml { render :xml => @results } >> end >> end >> >> Cheers > > You're stubbing User.search, but you don't actually call it. search > ends up being called on

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Pat Maddox
Neil Cauldwell <[EMAIL PROTECTED]> writes: > Is my stubbing breaking this? I hope not because Thinking SPhinx isn't > determining the scope of the search in relation to the 'active' state of > the users; the search is built on top of a named scope on the User > model; > > # GET /searches/peopl

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Neil Cauldwell
David Chelimsky wrote: > On Wed, Oct 1, 2008 at 2:33 AM, Neil Cauldwell <[EMAIL PROTECTED]> > wrote: >>> Also, what is your data? The matcher may not work as expected due to >> describe "handling GET /searches/people" do >> >> it "should not include any inactive users in an assigned array of use

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread David Chelimsky
On Wed, Oct 1, 2008 at 2:33 AM, Neil Cauldwell <[EMAIL PROTECTED]> wrote: > Ben Mabey wrote: >> Pat Maddox wrote: >>> ___ >>> rspec-users mailing list >>> rspec-users@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/rspec-users >>> >> >> >> Al

Re: [rspec-users] Spec for 'an array should not include an item'

2008-10-01 Thread Neil Cauldwell
Ben Mabey wrote: > Pat Maddox wrote: >>> >> ___ >> rspec-users mailing list >> rspec-users@rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > > > Also, what is your data? The matcher may not work as expected due to > nuances in

Re: [rspec-users] Spec for 'an array should not include an item'

2008-09-30 Thread Ben Mabey
Pat Maddox wrote: Neil Cauldwell <[EMAIL PROTECTED]> writes: Does anyone know how I can write a spec along the lines of this (but a working implementation); it "should not include inactive users" do do_get assigns[:results].should_not include(users(:inactive_user)) end I'm

Re: [rspec-users] Spec for 'an array should not include an item'

2008-09-30 Thread Pat Maddox
Neil Cauldwell <[EMAIL PROTECTED]> writes: > Does anyone know how I can write a spec along the lines of this (but a > working implementation); > >it "should not include inactive users" do > do_get > assigns[:results].should_not include(users(:inactive_user)) >end > > I'm a newbie

[rspec-users] Spec for 'an array should not include an item'

2008-09-30 Thread Neil Cauldwell
Does anyone know how I can write a spec along the lines of this (but a working implementation); it "should not include inactive users" do do_get assigns[:results].should_not include(users(:inactive_user)) end I'm a newbie so I'm not capable of explaining why it doesn't work, but h