Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 25 lines (20 sloc) 0.717 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
require "test_helper"

class Post
  attr_accessor :author
end

class FormHelperTest < ActionView::TestCase
  def test_text_field_tag
    assert_match(/autocomplete=\"some\/path\"/, text_field_tag('field_name', '', :autocomplete => 'some/path'))
  end

  def test_text_field
    post = Post.new
    assert_match(/autocomplete=\"some\/path\"/, text_field(:post, :author, :autocomplete => 'some/path'))
  end

  def test_autocomplete_field_tag
    assert_match(/data-autocomplete=\"some\/path\"/, autocomplete_field_tag('field_name', '', 'some/path'))
  end

  def test_autocomplete_field
    post= Post.new
    assert_match(/data-autocomplete=\"some\/path\"/, autocomplete_field(:post, :author, 'some/path'))
  end
end
Something went wrong with that request. Please try again.