Re: [rspec-users] GET a path in a controller spec

2010-02-21 Thread Pat Maddox
Extract redirect logic to an object or helper and test that. UrlRewriter.new.rewrite('/foods/search/almonds').should == '/almonds' helper.rewrite_url('/foods/search/almonds').should == '/almonds' and then you will see that this should probably be called higher up in the call stack, in a before_f

Re: [rspec-users] undefined method `has' in integration test

2010-02-21 Thread drewB
I require webrat in spec_helper (Spork.prefork). versions: rails 2.1.2 rspec 1.3.0 rspec-rails 1.3.2 ruby 1.8.7 The file is located at 'spec/integration/landing_page/ Ianding_page_spec.rb'. I am running 'spec spec/integration/ landing_page/landing_page_spec.rb' I am also using the rspec-integra

Re: [rspec-users] undefined method `has' in integration test

2010-02-21 Thread David Chelimsky
On Sun, Feb 21, 2010 at 5:25 PM, drewB wrote: > Whenever I use a matcher like response.should have_text in an > integration test I receive the following error: > > undefined method `has' for # 0x7fe07d184038> > > Any idea why that is and how to fix it? What versions of rails, rspec, and ruby are

Re: [rspec-users] undefined method `has' in integration test

2010-02-21 Thread Nicolás Sanguinetti
On Sun, Feb 21, 2010 at 9:25 PM, drewB wrote: > Whenever I use a matcher like response.should have_text in an > integration test I receive the following error: > > undefined method `has' for # 0x7fe07d184038> > > Any idea why that is and how to fix it? I think—not sure—those matchers are provided

[rspec-users] undefined method `has' in integration test

2010-02-21 Thread drewB
Whenever I use a matcher like response.should have_text in an integration test I receive the following error: undefined method `has' for # Any idea why that is and how to fix it? Thanks! ___ rspec-users mailing list rspec-users@rubyforge.org http://rub

Re: [rspec-users] Adding path for autotest to monitor

2010-02-21 Thread drewB
Thanks David. I was able to key of some of what you said in the blog. The solution for me was to add the following to my .autotest: Autotest.add_hook :initialize do |at| at.add_mapping(%r%^spec/(integration)/.*rb$%) { |filename, _| filename } end On Feb 19, 6:26 p

Re: [rspec-users] Problem running spec command for directory

2010-02-21 Thread David Chelimsky
On Sun, Feb 21, 2010 at 2:57 PM, Marcus Ahnve wrote: > Hi, > > I have a problem running the spec command in Rspec 1.3.0 with a > directory as parameter. > > A spec for a MongoMapper document that works when run directly such as > > $ spec spec/model/attendant_spec.rb > > works fine. But the very s

[rspec-users] Problem running spec command for directory

2010-02-21 Thread Marcus Ahnve
Hi, I have a problem running the spec command in Rspec 1.3.0 with a directory as parameter. A spec for a MongoMapper document that works when run directly such as $ spec spec/model/attendant_spec.rb works fine. But the very same spec run glob-style: $ spec spec fails with MongoMapper validati

Re: [rspec-users] Do you still Write Tests First on code that is churning hard?

2010-02-21 Thread Andrew Premdas
On 19 February 2010 08:59, Erik Pukinskis wrote: > Hello Specmeisters! > > I have a bit of a philosophical question for the TDD witches and > wizards out there. I'm working on some code that is really > churning... It's doing complicated calculations, but the actual > desired results are a movin

Re: [rspec-users] GET a path in a controller spec

2010-02-21 Thread Andrew Premdas
On 31 January 2010 22:02, Nick Hoffman wrote: > One of my controller actions sends a redirect if the request URI begins > with /foods/search > > 34 def search > 35return redirect_to "/#{params[:name]}" if > request.request_uri.match /^\/foods\/search/ > > Unfortunately, I can't figure out