Re: [rspec-users] Un-recognised routes that do exist, using namespaces & subdomain checking

2009-11-10 Thread David Chelimsky
On Tue, Nov 10, 2009 at 4:10 PM, DEfusion wrote: > Removing the :sub domain conditions from the namespace does fix the > issue, and moving the sub domain conditions to the individual route > definitions causes them all to fail. > > On Nov 10, 11:59 pm, DEfusion wrote: > > Okay I've managed to re

Re: [rspec-users] Un-recognised routes that do exist, using namespaces & subdomain checking

2009-11-10 Thread DEfusion
Removing the :sub domain conditions from the namespace does fix the issue, and moving the sub domain conditions to the individual route definitions causes them all to fail. On Nov 10, 11:59 pm, DEfusion wrote: > Okay I've managed to re-create my original problem by trying to use > params_from to

Re: [rspec-users] Un-recognised routes that do exist, using namespaces & subdomain checking

2009-11-10 Thread DEfusion
Okay I've managed to re-create my original problem by trying to use params_from to verify the routing (which was another area I was experiencing problems with before). Note each one of the routes I'm defining here all return fine in the browser, they hit the appropriate controller and run the show

Re: [rspec-users] Un-recognised routes that do exist, using namespaces & subdomain checking

2009-11-10 Thread DEfusion
Now that is weird. I tried to make an isolated example for you and that worked fine. So I put un-commented my spec bit by bit and it works fine. I'm sure I've had this problem before. If I do re-create it I'll post more details here. =D On Nov 10, 10:48 pm, David Chelimsky wrote: > On Tue, Nov

Re: [rspec-users] Un-recognised routes that do exist, using namespaces & subdomain checking

2009-11-10 Thread David Chelimsky
On Tue, Nov 10, 2009 at 2:25 PM, DEfusion wrote: > I'm getting really cheesed off with RSpec not matching some of my > routes when controller testing when I have subdomain checking > (courtesy of subdomain-fu) on namespaces. These routes appear in the > rake routes output, and work fine via HTTP

[rspec-users] Un-recognised routes that do exist, using namespaces & subdomain checking

2009-11-10 Thread DEfusion
I'm getting really cheesed off with RSpec not matching some of my routes when controller testing when I have subdomain checking (courtesy of subdomain-fu) on namespaces. These routes appear in the rake routes output, and work fine via HTTP requests . The really annoying thing is it's working fine

[rspec-users] Un-recognised routes that do exist, using namespaces & subdomain checking

2009-11-10 Thread DEfusion
Using RSpec 1.2.9 and Rails 2.3.4. RSpec is not matching some of my routes during controller testing when I have subdomain checking (courtesy of subdomain-fu) on namespaces. These routes appear in the rake routes output, and work fine via HTTP requests . The really annoying thing is it's working

[rspec-users] Model spec for file upload with paperclip and fastercsv

2009-11-10 Thread Ray K.
I just started my ImportsController and was this was really the way to go: import.rb/ class Import < ActiveRecord::Base has_attached_file :csv validates_attachment_presence :csv after_save :process_csv private def process_csv FasterCSV.foreach( csv.path) do

Re: [rspec-users] undefined method `route_for

2009-11-10 Thread David Chelimsky
On Tue, Nov 10, 2009 at 4:44 AM, Amit Kulkarni wrote: > Hi all, > I am writing scenarios for testing my routes but it is giving me error > as undefined method `route_for and also for params_from. > Did i miss something which i need to add in my controller > > My code is as follows: > > require Fi

Re: [rspec-users] Stub activerecord find given instance?

2009-11-10 Thread Tom Stuart
On 10 Nov 2009, at 14:08, Saverio Miroddi wrote: > Is there a clean/simple way of stubbing the activerecord find() for a > single instance? MyModel.stub(:find).with(42).and_return(myModel) ___ rspec-users mailing list rspec-users@rubyforge.org http://rub

[rspec-users] Stub activerecord find given instance?

2009-11-10 Thread Saverio Miroddi
Is there a clean/simple way of stubbing the activerecord find() for a single instance? As usual pattern, I see something like myModel = MyModel.new(...) MyModel.stub( :find ).and_return( myModel ) which can give problems in case we want to find other instances. ??? Saverio -- Posted via http:/

[rspec-users] undefined method `route_for

2009-11-10 Thread Amit Kulkarni
Hi all, I am writing scenarios for testing my routes but it is giving me error as undefined method `route_for and also for params_from. Did i miss something which i need to add in my controller My code is as follows: require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe H

Re: [rspec-users] Display Rspec output in an html file

2009-11-10 Thread Amit Kulkarni
I checked the whole code but there is no error as such. What i have done is i added a line i.e. t.spec_opts = ['--format' , 'html:result.html' ] under /lib/tasks/rspec.rake i.e. [:models, :controllers, :views, :helpers, :lib, :integration].each do |sub| desc "Run the code examples in spec/#{s

Re: [rspec-users] This test should pass, but it does not :-/ Why?

2009-11-10 Thread Alexander Seidl
Alexander Seidl wrote: > Alexander Seidl wrote: >> http://gist.github.com/230814 > > I should give some keywords here: > I set an expectation in the test that a redirect_to should take place if > a certain condition is made: @login_user.categories.size <= 0. > But the test fails and says: "expect

Re: [rspec-users] This test should pass, but it does not :-/ Why?

2009-11-10 Thread Alexander Seidl
Alexander Seidl wrote: > http://gist.github.com/230814 I should give some keywords here: I set an expectation in the test that a redirect_to should take place if a certain condition is made: @login_user.categories.size <= 0. But the test fails and says: "expected redirect to {:action=>"index"},

[rspec-users] This test should pass, but it does not :-/ Why?

2009-11-10 Thread Alexander Seidl
http://gist.github.com/230814 -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users