require 'test_helper' require 'action_view/test_case' class ViewHelperTest < ActionView::TestCase include Apotomo::TestCaseMethods::TestController tests Apotomo::Rails::ViewHelper context "A widget state view" do setup do @cell = mouse_mock('mum') end teardown do Apotomo.js_framework = :prototype end should "respond to #multipart_form_to_event" do assert_dom_equal "
", multipart_form_to_event(:footsteps) end should "render multipart form if :multipart => true" do assert_dom_equal "", form_to_event(:footsteps, :multipart => true) end should "respond to #trigger_event" do assert_dom_equal "new Ajax.Request(\"/barn/render_event_response?source=mum&type=footsteps\")", trigger_event(:footsteps) end should "render RightJS if set" do Apotomo.js_framework = :right assert_dom_equal "new Xhr(\"/barn/render_event_response?source=mum&type=footsteps\", {evalScripts:true}).send()", trigger_event(:footsteps) end should "respond to #url_for_event" do assert_equal("/barn/render_event_response?source=mum&type=footsteps", url_for_event(:footsteps)) end should "respond to #widget_div" do assert_equal '