[rspec-devel] [ rspec-Bugs-13020 ] ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods should not be included in helper specs?
noreply at rubyforge.org
noreply at rubyforge.org
Tue Aug 28 10:30:06 EDT 2007
Bugs item #13020, was opened at 2007-08-12 22:39
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13020&group_id=797
Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Mike Vincent (agile)
Assigned to: Nobody (None)
Summary: ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods should not be included in helper specs?
Initial Comment:
1.0.6+ includes additional modules into the helper specs.
including ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods
causes conflicts in helpers as it redefines several methods, such as <<
def simple_example(name)
markup = ''
markup << content_tag(:h1, "hello #{name}")
markup
end
simple_example('foo').should have_tag('h1', 'foo')
will throw a confusing method missing error from nil about the << method.
----------------------------------------------------------------------
Comment By: Jay Levitt (jaylev)
Date: 2007-08-28 10:30
Message:
I -think- this is fixed by http://rubyforge.org/tracker/?func=detail&group_id=797&aid=13065&atid=3149 instead. Right?
----------------------------------------------------------------------
Comment By: Ryan Bates (ryanb)
Date: 2007-08-21 14:54
Message:
+1
I had this problem which led to a lot of confusion since the error message is not very helpful. Commenting out the include statement fixed it, although it makes me wonder if I'm breaking something else by doing this. Why are the generator methods included in the first place?
At least my specs are passing again...
----------------------------------------------------------------------
Comment By: Mike Vincent (agile)
Date: 2007-08-20 21:26
Message:
I think maybe I wasn't clear in the original message. I
don't believe the GeneratorMethods module is intended to be
mixed into the helper context and breaks things while it is
included.
Not much clearer, I know. Someday me speak gooder.
Index:
vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/helper.rb
===================================================================
---
vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/helper.rb
(revision 2411)
+++
vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/helper.rb
(working copy)
@@ -32,7 +32,7 @@
include ActionView::Helpers::NumberHelper
include ActionView::Helpers::PaginationHelper
rescue nil #removed after 1.2.3
include ActionView::Helpers::PrototypeHelper
- include
ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods
+ #include
ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods
include ActionView::Helpers::ScriptaculousHelper
include ActionView::Helpers::TagHelper
include ActionView::Helpers::TextHelper
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13020&group_id=797
More information about the rspec-devel
mailing list