Sha256: 995c842a4d64e4df9eed1223c38c16a747a920bf1dfa70732d3a048c36ce845e

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

# encoding: UTF-8
require 'test_helper'

class TextInputTest < ActionView::TestCase
  test 'input should generate a text area for text attributes' do
    with_input_for @user, :description, :text
    assert_select 'textarea.text#user_description'
  end

  test 'input should generate a text area for text attributes that accept placeholder' do
    with_input_for @user, :description, :text, :placeholder => 'Put in some text'
    assert_select 'textarea.text[placeholder=Put in some text]'
  end

  test 'input should get maxlength from column definition for text attributes' do
    with_input_for @user, :description, :text
    assert_select 'textarea.text[maxlength=200]'
  end

  test 'input should infer maxlength column definition from validation when present for text attributes' do
    with_input_for @validating_user, :description, :text
    assert_select 'textarea.text[maxlength=50]'
  end

  test 'input should infer minlength column definition from validation when present for text attributes' do
    with_input_for @validating_user, :description, :text
    assert_select 'textarea.text[minlength=5]'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_form_with_client_validation-0.0.2 test/inputs/text_input_test.rb
simple_form_with_client_validation-0.0.0 test/inputs/text_input_test.rb