[rspec-devel] [ rspec-Bugs-13713 ] form helper method 'select' can not be called when calling custom helper methods from specs

noreply at rubyforge.org noreply at rubyforge.org
Thu Sep 6 06:55:27 EDT 2007


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

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Juha Suuraho (juhazi)
Assigned to: Nobody (None)
Summary: form helper method 'select' can not be called when calling custom helper methods from specs

Initial Comment:
Method select from ActionView::Helpers::FormOptionsHelper cannot be called from helper specs.

helper code:
  def return_a_select
    select(:test_object, :test_method, ["1",1])
  end

spec code:
  it "should return a select input tag" do
    return_a_select.should_not be_nil
  end

result:
  ArgumentError in 'CompaniesHelper should return a select input tag'
  wrong number of arguments (3 for 1)

suggested reason:
  in /vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/helper.rb:
+++++++++++++++++++++++++++++++++++++++
          module ExampleMethods
.....
          include ActionView::Helpers::FormHelper
          include ActionView::Helpers::FormOptionsHelper
          include ActionView::Helpers::FormTagHelper
.....
          include ActionView::Helpers::PrototypeHelper
          include ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods
          include ActionView::Helpers::ScriptaculousHelper
++++++++++++++++++++++++++++++++++++++++
as you can see FormOptionsHelper is included before PrototypeHelper::JavaScriptGenerator::GeneratorMethods, which in my opinion results in the select helper method from latter to overwrite the former.

I'm not sure how this could be fixed if the latter helper module is by default included in all helpers.

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

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


More information about the rspec-devel mailing list