I tried reading up the RSPEC Book (Dec 2010) and googled a bit but I
could not find anything.
I’m using Rspec2.
factory :category_intakes, :class => ‘category’ do
name ‘intakes and filters’
description ‘airfilters and etc.’
factory :category_audio, :class => ‘category’ do
description ‘in car entertainment’
describe “categories/index.html.erb” do
assign( :categories, [
it “renders a list of categories” do
assert_select “tr>td”, :text => “intakes and filters”.to_s, :count
assert_select “tr>td”, :text => “audio”.to_s, :count => 1
I noticed that the index view spec above passes but when I change the
count to 2, it fails saying that only 1 element is expected.
- what does :count actually mean? Does it mean the total number of
fixture objects expected?
- does the ordering of the rendered fixture items matter
( ie. :category_audio is expected before :category_intakes)?