squeak!<\\/div>\")", @mum.invoke(:squeak)
end
should "accept :selector" do
@mum.instance_eval do
def squeak
replace :text => '
', :selector => "div#mouse"
end
end
assert_equal "$(\"div#mouse\").replace(\"
squeak!<\\/div>\")", @mum.invoke(:squeak)
end
end
end
context "rendering a widget family" do
setup do
@mum = mouse_mock('mum', :snuggle) do
def snuggle; render; end
end
@mum << @kid = mouse_mock('kid')
end
should "per default render kid's content inside mums div with rendered_children" do
assert_equal '
', @mum.invoke(:snuggle)
end
should "skip kids if :render_children=>false but still provide a rendered_children hash" do
@mum.instance_eval do
def snuggle; render :render_children => false; end
end
assert_equal '
', @mum.invoke(:snuggle)
end
should_eventually "provide an ordered rendered_children hash"
end
end