2017-10-23 21:01:08 -04:00
|
|
|
# frozen_string_literal: true
|
2011-09-03 12:49:54 -04:00
|
|
|
# encoding: UTF-8
|
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class FileInputTest < ActionView::TestCase
|
2014-05-14 13:19:06 -04:00
|
|
|
test 'input generates a file field' do
|
2011-09-03 12:49:54 -04:00
|
|
|
with_input_for @user, :name, :file
|
|
|
|
assert_select 'input#user_name[type=file]'
|
|
|
|
end
|
|
|
|
|
2014-05-14 13:19:06 -04:00
|
|
|
test "input generates a file field that doesn't accept placeholder" do
|
2013-01-28 16:02:59 -05:00
|
|
|
store_translations(:en, simple_form: { placeholders: { user: { name: "text" } } }) do
|
2011-12-04 07:29:59 -05:00
|
|
|
with_input_for @user, :name, :file
|
|
|
|
assert_no_select 'input[placeholder]'
|
|
|
|
end
|
2011-09-03 12:49:54 -04:00
|
|
|
end
|
|
|
|
end
|