Re: [rspec-users] Testing Routing Constraint => redirect example.com to www.example.com

2011-08-02 Thread Justin Ko
On Mon, Aug 1, 2011 at 8:29 PM, Shane Mingins wrote: > Hi All > > With the following route > > constraints(:host => "example.com") do > match "(*x)" => redirect { |params, request| > URI.parse(request.url).tap { |x| x.host = "www.example.com" }.to_s > } > end > > > I am wonderin

[rspec-users] Best way to test tasks

2011-08-02 Thread Piter Fcbk
I have a task that runs frequently in order to get/import data from another system. Because of this I wanted to know which is the best way to test tasks in order to create the tests needed. Thanks in advance. ___ rspec-users mailing list rspec-users@ruby

Re: [rspec-users] Best way to test tasks

2011-08-02 Thread Michael Guterl
On Tue, Aug 2, 2011 at 4:41 PM, Piter Fcbk wrote: > I have a task that runs frequently in order to get/import data from another > system. > Because of this I wanted to know which is the best way to test tasks in > order to create the tests needed. > > Thanks in advance. > Assuming you are asking

Re: [rspec-users] Best way to test tasks

2011-08-02 Thread Pat Maddox
On Aug 2, 2011, at 4:41 PM, Piter Fcbk wrote: > I have a task that runs frequently in order to get/import data from another > system. > Because of this I wanted to know which is the best way to test tasks in order > to create the tests needed. > > Thanks in advance. I write simple objects that

Re: [rspec-users] Best way to test tasks

2011-08-02 Thread Piter Fcbk
You are right, I'm talking about rake task. So the idea is to make an Importer object, do the unit test for that object and then the task just calls the methods of the objects right? Thanks a lot for the help, really appreciate it. On Tue, Aug 2, 2011 at 6:31 PM, Pat Maddox wrote: > On Aug 2, 2

Re: [rspec-users] Testing Routing Constraint => redirect example.com to www.example.com

2011-08-02 Thread Shane Mingins
Thanks for that Justin! I was not aware of request specs http://relishapp.com/rspec/rspec-rails/v/2-6/dir/request-specs/request-spec... could not find any reference to them in the rspec book (maybe I missed them). so adding spec/requests/routes_spec.rb with the following did the trick! require

Re: [rspec-users] Best way to test tasks

2011-08-02 Thread Justin Ko
On Tue, Aug 2, 2011 at 5:52 PM, Piter Fcbk wrote: > You are right, I'm talking about rake task. > So the idea is to make an Importer object, do the unit test for that object > and then the task just calls the methods of the objects right? > > Thanks a lot for the help, really appreciate it. > > >

Re: [rspec-users] Testing Routing Constraint => redirect example.com to www.example.com

2011-08-02 Thread Justin Ko
On Tue, Aug 2, 2011 at 8:19 PM, Shane Mingins wrote: > Thanks for that Justin! > > I was not aware of request specs > http://relishapp.com/rspec/rspec-rails/v/2-6/dir/request-specs/request-spec... > could not find any reference to them in the rspec book (maybe I missed > them). > > so adding spe