2017-07-23 11:36:41 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2010-03-17 19:28:05 -04:00
|
|
|
require "abstract_unit"
|
|
|
|
require "template/erb/helper"
|
|
|
|
|
|
|
|
module ERBTest
|
|
|
|
class TagHelperTest < BlockTestCase
|
|
|
|
test "form_for works" do
|
2018-09-24 17:49:26 -04:00
|
|
|
routes = ActionDispatch::Routing::RouteSet.new
|
|
|
|
routes.draw do
|
|
|
|
get "/blah/update", to: "blah#update"
|
|
|
|
end
|
|
|
|
output = render_content "form_for(:staticpage, :url => {:controller => 'blah', :action => 'update'})", "", routes
|
2010-06-28 00:12:10 -04:00
|
|
|
assert_match %r{<form.*action="/blah/update".*method="post">.*</form>}, output
|
2010-03-17 19:28:05 -04:00
|
|
|
end
|
|
|
|
end
|
2010-04-05 17:41:35 -04:00
|
|
|
end
|