[rspec-devel] [ rspec-Bugs-13699 ] In HelperSpec with_routing is not working

noreply at rubyforge.org noreply at rubyforge.org
Wed Sep 5 20:14:43 EDT 2007


Bugs item #13699, was opened at 2007-09-06 12:14
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13699&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Shane Mingins (smingins)
Assigned to: Nobody (None)
Summary: In HelperSpec with_routing is not working

Initial Comment:
In version 1.05 we have specs with examples like:


describe SomeHelper do

  it "should work with_routing" do
    with_routing do |set|
      set.draw do |map|
        map.resources :thoughts
      end
      
      thought_path(:id => 1).should == "/thoughts/1"
    end
  end

end

and this works and passes fine.

In version 1.08 this does not work and throws an exception similar to the named routes problem that was fixed by installing the routes to the ExampleMethods modules.  That fix does not fix this problem and I am wondering as to how 1.05 has access to the routeset as opposed to trunk adding:

ActionController::Routing::Routes.named_routes.install(self)

The exception message (from my spec called CommentsHelperSpec is:


You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<
/Users/smingins/Work/comments_new/config/../vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:538:in `<<'
/Users/smingins/Work/comments_new/config/../vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:695:in `initialize'
/Users/smingins/Work/comments_new/config/../vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:616:in `new'
/Users/smingins/Work/comments_new/config/../vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:616:in `method_missing'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/matchers.rb:159:in `method_missing'
./spec/helper/comments_helper_spec.rb:27:
/Users/smingins/Work/comments_new/config/../vendor/rails/actionpack/lib/action_controller/test_process.rb:487:in `with_routing'
./spec/helper/comments_helper_spec.rb:22:
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/dsl/example.rb:81:in `instance_eval'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/dsl/example.rb:81:in `run_example'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/dsl/example.rb:26:in `run'
/opt/local/lib/ruby/1.8/timeout.rb:48:in `timeout'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/dsl/example.rb:24:in `run'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:81:in `run'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:75:in `each'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/dsl/behaviour.rb:75:in `run'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:58:in `run_behaviours'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:57:in `each'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:57:in `run_behaviours'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:21:in `run'
/Users/smingins/Work/comments_new/vendor/plugins/rspec/lib/spec/runner/command_line.rb:17:in `run'
./script/spec:4:


Please let me know if I have provided enough information.



----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13699&group_id=797


More information about the rspec-devel mailing list