On Oct 20, 2010, at 11:34 PM, Ishit Parikh wrote:

> I want test case in rspec for:
> @drugs = Drug.where('drug_category_id = ?', params[:id])
> 
> Has anybody idea about it?

describe Drug
  it "should really be posted to the rSpec Google Group :)"
  it "would be helpful for you to read the Prag. Programmers rSpec book"

  it "find Drugs if they exist" do
    Drug.where('drug_category_id = ?', params[:id]).should have(1).record
  end
end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to