aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/erb/form_for_test.rb
blob: b3a47e17a4f5a7cc7a235176bd574c9109300daa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

require "abstract_unit"
require "template/erb/helper"

module ERBTest
  class TagHelperTest < BlockTestCase
    test "form_for works" do
      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
      assert_match %r{<form.*action="/blah/update".*method="post">.*</form>}, output
    end
  end
end