[rspec-users] How-to spec this helper method?...
loop at superinfinite.com
Mon Dec 24 08:48:12 EST 2007
On 24 dec 2007, at 05:09, David Chelimsky wrote:
> On Dec 20, 2007 4:31 AM, Bart Zonneveld <loop at superinfinite.com>
>> Hey gang,
>> I have this dead-simple method defined in a helper:
>> def add_category_link(name)
>> link_to_function name do |page|
>> page.insert_html :bottom, :categories, :partial =>
>> 'category', :object => Category.new
>> Where, and mostly how, would I spec this? I haven't been able to find
>> how to stub the rjs in a helper spec, so I'd appreciate any pointers
> If you can spec it in a template using rjs, you can do it in a helper:
> describe FooHelper do
> it "should build a category link" do
> add_category_link(:foo).should have_rjs(...)
Thanks! However, I am getting an error about 'nil.render' now, with
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.render
No idea how to fix this :(...
thanks in advance, and happy Christmas and all!
More information about the rspec-users