[rspec-devel] [ rspec-Bugs-14824 ] Spec::Runner.configuration.include does not work for ActionController::UrlWriter

noreply at rubyforge.org noreply at rubyforge.org
Thu Oct 18 02:25:06 EDT 2007


Bugs item #14824, was opened at 2007-10-17 18:40
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=14824&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Brian Takita (btakita)
>Assigned to: Nobody (None)
Summary: Spec::Runner.configuration.include does not work for ActionController::UrlWriter

Initial Comment:
Spec::Runner.configure do |config|
  config.include ActionController::UrlWriter
end

Inside of UrlRewriter is:
module ActionController::UrlWriter
  def self.included(base) #:nodoc:
    ActionController::Routing::Routes.named_routes.install base
    base.mattr_accessor :default_url_options
    base.default_url_options ||= default_url_options
  end
end

Here is the error message:
NoMethodError in 'BlockingsController destroy redirects on successful destroy'
undefined method `default_url_options' for #<Class:0x4cf45c8>
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/url_rewriter.rb:41:in `url_for'
(eval):19:in `user_contacts_path'
/Users/pivotal/workspace/socialitis/vendor/plugins/connections/spec/controllers/blockings_controller_spec.rb:30:
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_module.rb:171:in `instance_eval'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_module.rb:171:in `run_example'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_runner.rb:65:in `run_example'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_runner.rb:26:in `run'
/usr/local/lib/ruby/1.8/timeout.rb:48:in `timeout'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_runner.rb:24:in `run'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_suite.rb:26:in `rspec_run'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_suite.rb:22:in `each'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/dsl/example_suite.rb:22:in `rspec_run'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/test/unit/example_suite.rb:7:in `run'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:12:in `run'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:11:in `each'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/runner/behaviour_runner.rb:11:in `run'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec/runner/options.rb:71:in `run_examples'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec.rb:18:in `run'
/Users/pivotal/workspace/socialitis/vendor/plugins/rspec/lib/spec.rb:27:
-e:1:


The following does work:
class Spec::DSL::Example
  include ActionController::UrlWriter
end

class Spec::Test::Unit::Example
  include ActionController::UrlWriter
end


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

>Comment By: Brian Takita (btakita)
Date: 2007-10-17 23:25

Message:
Spec::Runner.configure do |config|
  include ActionController::UrlWriter
end

also works.

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

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


More information about the rspec-devel mailing list