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

Ben Mabey ben at benmabey.com
Tue Sep 30 14:57:03 EDT 2008


Pat Maddox wrote:
> Neil Cauldwell <lists at ruby-forum.com> 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 so I'm not capable of explaining why it doesn't work, but
>> hopefully someone can set me straight.
>>
>> Thanks
>>     
>
> What's the error you're getting?  Because, assuming that stuff is hooked
> up properly, this ought to work fine.
>
> Pat
> _______________________________________________
> rspec-users mailing list
> rspec-users at 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 your data.  For example, STI tends to mess things up in cases 
like this.

-Ben


More information about the rspec-users mailing list