From a-iparikh at gloscon.com Thu Oct 21 02:35:56 2010 From: a-iparikh at gloscon.com (a-iparikh) Date: Wed, 20 Oct 2010 23:35:56 -0700 (PDT) Subject: [rspec-devel] Want test case in rspec Message-ID: <30016587.post@talk.nabble.com> I want test case in rspec for: @drugs = Drug.where('drug_category_id = ?', params[:id]) has anybody solution for it? -- View this message in context: http://old.nabble.com/Want-test-case-in-rspec-tp30016587p30016587.html Sent from the rspec-devel mailing list archive at Nabble.com. From dchelimsky at gmail.com Thu Oct 21 07:53:05 2010 From: dchelimsky at gmail.com (David Chelimsky) Date: Thu, 21 Oct 2010 06:53:05 -0500 Subject: [rspec-devel] Want test case in rspec In-Reply-To: <30016587.post@talk.nabble.com> References: <30016587.post@talk.nabble.com> Message-ID: On Oct 21, 2010, at 1:35 AM, a-iparikh wrote: > I want test case in rspec for: > @drugs = Drug.where('drug_category_id = ?', params[:id]) > has anybody solution for it? Please use the rspec-users mailing list for usage questions (I CC'd rspec-devel to make sure you'd get this). You haven't provided much information here. You're asking how to test a line of code, but what we want to do is specify behaviour of objects at a higher level than that. I'm guessing that this is a controller in a Rails 3 app. Can you tell us which controller this is (DrugsController, DrugCategoriesController, DrugUsersController, etc), what action this is, and what you expect this action to do? From a-iparikh at gloscon.com Thu Oct 21 09:00:33 2010 From: a-iparikh at gloscon.com (Ishit Parikh) Date: Thu, 21 Oct 2010 18:30:33 +0530 Subject: [rspec-devel] Want test case in rspec In-Reply-To: References: <30016587.post@talk.nabble.com> Message-ID: Hi David, Thanks for your interest. It's a DrugsController. This line of code is of index action in controller. I have taken "@drugs" object. I want to show drugs of selected drug_category on the index page. I am new to rspec so couldn't write spec for it or found on web. Awaiting for your reply. Thanking You, Ishit Parikh On Thu, Oct 21, 2010 at 5:23 PM, David Chelimsky wrote: > On Oct 21, 2010, at 1:35 AM, a-iparikh wrote: > > > I want test case in rspec for: > > @drugs = Drug.where('drug_category_id = ?', params[:id]) > > has anybody solution for it? > > Please use the rspec-users mailing list for usage questions (I CC'd > rspec-devel to make sure you'd get this). > > You haven't provided much information here. You're asking how to test a > line of code, but what we want to do is specify behaviour of objects at a > higher level than that. I'm guessing that this is a controller in a Rails 3 > app. Can you tell us which controller this is (DrugsController, > DrugCategoriesController, DrugUsersController, etc), what action this is, > and what you expect this action to do? > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a-iparikh at gloscon.com Thu Oct 21 09:02:32 2010 From: a-iparikh at gloscon.com (a-iparikh) Date: Thu, 21 Oct 2010 06:02:32 -0700 (PDT) Subject: [rspec-devel] Want test case in rspec In-Reply-To: References: <30016587.post@talk.nabble.com> Message-ID: <30019289.post@talk.nabble.com> Hi David, Thanks for your interest. It's a DrugsController. This line of code is of index action in controller. I have taken "@drugs" object. I want to show drugs of selected drug_category on the index page. I am new to rspec so couldn't write spec for it or found on web. David Chelimsky-2 wrote: > > On Oct 21, 2010, at 1:35 AM, a-iparikh wrote: > >> I want test case in rspec for: >> @drugs = Drug.where('drug_category_id = ?', params[:id]) >> has anybody solution for it? > > Please use the rspec-users mailing list for usage questions (I CC'd > rspec-devel to make sure you'd get this). > > You haven't provided much information here. You're asking how to test a > line of code, but what we want to do is specify behaviour of objects at a > higher level than that. I'm guessing that this is a controller in a Rails > 3 app. Can you tell us which controller this is (DrugsController, > DrugCategoriesController, DrugUsersController, etc), what action this is, > and what you expect this action to do? > _______________________________________________ > rspec-devel mailing list > rspec-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-devel > > -- View this message in context: http://old.nabble.com/Want-test-case-in-rspec-tp30016587p30019289.html Sent from the rspec-devel mailing list archive at Nabble.com.