require 'test_helper' module ExpressAdmin class SmartFormTest < ActiveSupport::TestCase def resource_assigns {resource: Widget.new, collection: Widget.all} end def helpers view = mock_action_view(resource_assigns) class << view def widget_path(widget_id) "/widgets/#{widget_id.to_param}" end alias resource_path widget_path def widgets_path "/widgets" end alias collection_path widgets_path def admin_widgets_path "/admin/widgets" end end view end def widget_form(*args) arbre { smart_form(:widgets, *args) } end test "renders a form correct id" do assert_match '