simple_form 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +41 -0
- data/MIT-LICENSE +1 -1
- data/README.md +12 -13
- data/lib/generators/simple_form/templates/config/initializers/simple_form.rb +0 -6
- data/lib/generators/simple_form/templates/config/initializers/simple_form_bootstrap.rb +24 -23
- data/lib/simple_form/components/errors.rb +5 -1
- data/lib/simple_form/form_builder.rb +29 -10
- data/lib/simple_form/inputs/base.rb +4 -1
- data/lib/simple_form/inputs/boolean_input.rb +1 -0
- data/lib/simple_form/inputs/color_input.rb +14 -0
- data/lib/simple_form/inputs/priority_input.rb +0 -4
- data/lib/simple_form/inputs/string_input.rb +1 -1
- data/lib/simple_form/inputs.rb +1 -0
- data/lib/simple_form/tags.rb +6 -2
- data/lib/simple_form/version.rb +1 -1
- data/lib/simple_form.rb +21 -4
- data/test/action_view_extensions/builder_test.rb +22 -4
- data/test/form_builder/association_test.rb +6 -0
- data/test/form_builder/error_test.rb +6 -0
- data/test/form_builder/general_test.rb +19 -20
- data/test/form_builder/input_field_test.rb +3 -9
- data/test/form_builder/wrapper_test.rb +1 -1
- data/test/inputs/boolean_input_test.rb +8 -0
- data/test/inputs/collection_check_boxes_input_test.rb +8 -0
- data/test/inputs/collection_radio_buttons_input_test.rb +8 -0
- data/test/inputs/color_input_test.rb +10 -0
- data/test/inputs/datetime_input_test.rb +2 -12
- data/test/inputs/disabled_test.rb +13 -0
- data/test/inputs/discovery_test.rb +21 -0
- data/test/inputs/priority_input_test.rb +6 -14
- data/test/inputs/string_input_test.rb +8 -15
- data/test/support/discovery_inputs.rb +7 -0
- data/test/support/misc_helpers.rb +6 -0
- data/test/support/models.rb +25 -6
- data/test/test_helper.rb +6 -3
- metadata +40 -37
@@ -239,31 +239,24 @@ class FormBuilderTest < ActionView::TestCase
|
|
239
239
|
assert_select 'form select#user_updated_at_1i.datetime'
|
240
240
|
end
|
241
241
|
|
242
|
-
test 'builder generates file for
|
243
|
-
|
244
|
-
|
245
|
-
@user.avatar.expect(:!, false)
|
246
|
-
|
247
|
-
with_form_for @user, :avatar
|
248
|
-
assert_select 'form input#user_avatar.file'
|
242
|
+
test 'builder generates file input for ActiveStorage >= 5.2 and Refile >= 0.2.0 <= 0.4.0' do
|
243
|
+
with_form_for UserWithAttachment.build, :avatar
|
244
|
+
assert_select 'form input#user_with_attachment_avatar.file'
|
249
245
|
end
|
250
246
|
|
251
|
-
test 'builder generates file for
|
252
|
-
|
253
|
-
|
254
|
-
@user.avatar.expect(:!, false)
|
255
|
-
|
256
|
-
with_form_for @user, :avatar
|
257
|
-
assert_select 'form input#user_avatar.file'
|
247
|
+
test 'builder generates file input for Shrine >= 0.9.0, Refile >= 0.6.0 and CarrierWave >= 0.2.1' do
|
248
|
+
with_form_for UserWithAttachment.build, :cover
|
249
|
+
assert_select 'form input#user_with_attachment_cover.file'
|
258
250
|
end
|
259
251
|
|
260
|
-
test 'builder generates file for
|
261
|
-
|
262
|
-
|
263
|
-
|
252
|
+
test 'builder generates file input for Refile >= 0.4.0 and Shrine >= 0.9.0' do
|
253
|
+
with_form_for UserWithAttachment.build, :profile_image
|
254
|
+
assert_select 'form input#user_with_attachment_profile_image.file'
|
255
|
+
end
|
264
256
|
|
265
|
-
|
266
|
-
|
257
|
+
test 'builder generates file input for Paperclip ~> 2.0' do
|
258
|
+
with_form_for UserWithAttachment.build, :portrait
|
259
|
+
assert_select 'form input#user_with_attachment_portrait.file'
|
267
260
|
end
|
268
261
|
|
269
262
|
test 'build generates select if a collection is given' do
|
@@ -271,6 +264,12 @@ class FormBuilderTest < ActionView::TestCase
|
|
271
264
|
assert_select 'form select#user_age.select'
|
272
265
|
end
|
273
266
|
|
267
|
+
test 'builder does not generate url fields for columns that contain only the letters url' do
|
268
|
+
with_form_for @user, :hourly
|
269
|
+
assert_no_select 'form input#user_url.string.url'
|
270
|
+
assert_select 'form input#user_hourly.string'
|
271
|
+
end
|
272
|
+
|
274
273
|
test 'builder allows overriding default input type for text' do
|
275
274
|
with_form_for @user, :name, as: :text
|
276
275
|
assert_no_select 'form input#user_name'
|
@@ -3,12 +3,6 @@ require 'test_helper'
|
|
3
3
|
|
4
4
|
# Tests for f.input_field
|
5
5
|
class InputFieldTest < ActionView::TestCase
|
6
|
-
def with_input_field_for(object, *args)
|
7
|
-
with_concat_form_for(object) do |f|
|
8
|
-
f.input_field(*args)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
6
|
test "builder input_field only renders the input tag, nothing else" do
|
13
7
|
with_input_field_for @user, :name
|
14
8
|
|
@@ -85,13 +79,13 @@ class InputFieldTest < ActionView::TestCase
|
|
85
79
|
test 'builder input_field infers pattern from attributes' do
|
86
80
|
with_input_field_for @other_validating_user, :country, as: :string, pattern: true
|
87
81
|
|
88
|
-
assert_select '
|
82
|
+
assert_select "input:match('pattern', ?)", /\w+/
|
89
83
|
end
|
90
84
|
|
91
85
|
test 'builder input_field accepts custom pattern' do
|
92
86
|
with_input_field_for @other_validating_user, :country, as: :string, pattern: '\d+'
|
93
87
|
|
94
|
-
assert_select '
|
88
|
+
assert_select "input:match('pattern', ?)", /\\d+/
|
95
89
|
end
|
96
90
|
|
97
91
|
test 'builder input_field uses readonly component' do
|
@@ -138,7 +132,7 @@ class InputFieldTest < ActionView::TestCase
|
|
138
132
|
swap_wrapper :default, custom_wrapper_with_html5_components do
|
139
133
|
with_input_field_for @user, :name, pattern: '\w+'
|
140
134
|
|
141
|
-
assert_select '
|
135
|
+
assert_select "input:match('pattern', ?)", /\w+/
|
142
136
|
end
|
143
137
|
end
|
144
138
|
|
@@ -161,7 +161,7 @@ class WrapperTest < ActionView::TestCase
|
|
161
161
|
test 'custom wrappers can have full error message on attributes' do
|
162
162
|
swap_wrapper :default, custom_wrapper_with_full_error do
|
163
163
|
with_form_for @user, :name
|
164
|
-
assert_select 'span.error', "Name cannot be blank"
|
164
|
+
assert_select 'span.error', "Super User Name! cannot be blank"
|
165
165
|
end
|
166
166
|
end
|
167
167
|
|
@@ -107,6 +107,14 @@ class BooleanInputTest < ActionView::TestCase
|
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
110
|
+
test 'input boolean with nested generates a disabled hidden field with the form attribute when it is given' do
|
111
|
+
swap SimpleForm, boolean_style: :nested do
|
112
|
+
with_input_for @user, :active, :boolean, input_html: { form: 'form_id' }
|
113
|
+
|
114
|
+
assert_select "input[type=hidden][form=form_id]+ label.boolean > input.boolean"
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
110
118
|
test 'input accepts changing boolean style to nested through given options' do
|
111
119
|
with_input_for @user, :active, :boolean, boolean_style: :nested
|
112
120
|
assert_select 'label[for=user_active]', 'Active'
|
@@ -316,4 +316,12 @@ class CollectionCheckBoxesInputTest < ActionView::TestCase
|
|
316
316
|
assert_select 'span.checkbox > label', '200'
|
317
317
|
end
|
318
318
|
end
|
319
|
+
|
320
|
+
test 'input check boxes with inline style support label custom classes' do
|
321
|
+
swap SimpleForm, boolean_style: :inline do
|
322
|
+
with_input_for @user, :gender, :check_boxes, collection: %i[male female], item_label_class: 'beautiful-label'
|
323
|
+
|
324
|
+
assert_select 'label.beautiful-label', count: 2
|
325
|
+
end
|
326
|
+
end
|
319
327
|
end
|
@@ -439,4 +439,12 @@ class CollectionRadioButtonsInputTest < ActionView::TestCase
|
|
439
439
|
assert_select 'span.radio > label', '200'
|
440
440
|
end
|
441
441
|
end
|
442
|
+
|
443
|
+
test 'input check boxes with inline style support label custom classes' do
|
444
|
+
swap SimpleForm, boolean_style: :inline do
|
445
|
+
with_input_for @user, :gender, :radio_buttons, collection: %i[male female], item_label_class: 'beautiful-label'
|
446
|
+
|
447
|
+
assert_select 'label.beautiful-label', count: 2
|
448
|
+
end
|
449
|
+
end
|
442
450
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
|
5
|
+
class ColorInputTest < ActionView::TestCase
|
6
|
+
test 'input generates a color field' do
|
7
|
+
with_input_for @user, :favorite_color, :color
|
8
|
+
assert_select 'input[type=color].color#user_favorite_color'
|
9
|
+
end
|
10
|
+
end
|
@@ -6,12 +6,7 @@ require 'test_helper'
|
|
6
6
|
class DateTimeInputWithHtml5Test < ActionView::TestCase
|
7
7
|
test 'input generates a datetime input for datetime attributes if HTML5 compatibility is explicitly enbled' do
|
8
8
|
with_input_for @user, :created_at, :datetime, html5: true
|
9
|
-
|
10
|
-
if ActionPack::VERSION::STRING >= '5'
|
11
|
-
assert_select 'input[type="datetime-local"]'
|
12
|
-
elsif ActionPack::VERSION::STRING < '5'
|
13
|
-
assert_select 'input[type="datetime"]'
|
14
|
-
end
|
9
|
+
assert_select 'input[type="datetime-local"]'
|
15
10
|
end
|
16
11
|
|
17
12
|
test 'input generates a datetime select for datetime attributes' do
|
@@ -80,12 +75,7 @@ class DateTimeInputWithoutHtml5Test < ActionView::TestCase
|
|
80
75
|
test 'input generates a datetime input for datetime attributes if HTML5 compatibility is explicitly enabled' do
|
81
76
|
swap_wrapper do
|
82
77
|
with_input_for @user, :created_at, :datetime, html5: true
|
83
|
-
|
84
|
-
if ActionPack::VERSION::STRING >= '5'
|
85
|
-
assert_select 'input[type="datetime-local"]'
|
86
|
-
elsif ActionPack::VERSION::STRING < '5'
|
87
|
-
assert_select 'input[type="datetime"]'
|
88
|
-
end
|
78
|
+
assert_select 'input[type="datetime-local"]'
|
89
79
|
end
|
90
80
|
end
|
91
81
|
|
@@ -76,4 +76,17 @@ class DisabledTest < ActionView::TestCase
|
|
76
76
|
with_input_for @user, :created_at, :datetime
|
77
77
|
assert_no_select 'select.datetime.disabled[disabled]'
|
78
78
|
end
|
79
|
+
|
80
|
+
test 'input_field collection allows disabled select' do
|
81
|
+
with_input_field_for @user, :description, collection: ['foo', 'bar'], disabled: true
|
82
|
+
assert_select 'select[disabled]'
|
83
|
+
assert_no_select 'option[disabled]'
|
84
|
+
end
|
85
|
+
|
86
|
+
test 'input_field collection allows individual disabled options' do
|
87
|
+
with_input_field_for @user, :description, collection: ['foo', 'bar'], disabled: 'bar'
|
88
|
+
assert_no_select 'select[disabled]'
|
89
|
+
assert_no_select 'option[disabled][value=foo]'
|
90
|
+
assert_select 'option[disabled][value=bar]'
|
91
|
+
end
|
79
92
|
end
|
@@ -15,6 +15,7 @@ class DiscoveryTest < ActionView::TestCase
|
|
15
15
|
Object.send :remove_const, :CustomizedInput
|
16
16
|
Object.send :remove_const, :DeprecatedInput
|
17
17
|
Object.send :remove_const, :CollectionSelectInput
|
18
|
+
Object.send :remove_const, :FileInput
|
18
19
|
CustomInputs.send :remove_const, :CustomizedInput
|
19
20
|
CustomInputs.send :remove_const, :PasswordInput
|
20
21
|
CustomInputs.send :remove_const, :NumericInput
|
@@ -109,6 +110,26 @@ class DiscoveryTest < ActionView::TestCase
|
|
109
110
|
end
|
110
111
|
end
|
111
112
|
|
113
|
+
test 'does not duplicate the html classes giving a extra class' do
|
114
|
+
discovery do
|
115
|
+
swap SimpleForm, input_class: 'custom-default-input-class' do
|
116
|
+
with_form_for @user, :active, as: :select
|
117
|
+
assert_select 'form select#user_active.select' do
|
118
|
+
# Make sure class list contains 'chosen' only once.
|
119
|
+
assert_select ":match('class', ?)", /^(?!.*\bchosen\b.*\bchosen\b).*\bchosen\b.*$/
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
test 'new inputs can override the default input_html_classes' do
|
126
|
+
discovery do
|
127
|
+
with_form_for @user, :avatar, as: :file
|
128
|
+
assert_no_select 'form input[type=file]#user_avatar.file.file-upload'
|
129
|
+
assert_select 'form input[type=file]#user_avatar.file-upload'
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
112
133
|
test 'inputs method without wrapper_options are deprecated' do
|
113
134
|
discovery do
|
114
135
|
assert_deprecated do
|
@@ -6,22 +6,14 @@ class PriorityInputTest < ActionView::TestCase
|
|
6
6
|
test 'input generates a country select field' do
|
7
7
|
with_input_for @user, :country, :country
|
8
8
|
assert_select 'select#user_country'
|
9
|
-
|
10
|
-
assert_select 'select option[value=BR]', 'Brazil'
|
11
|
-
elsif ActionPack::VERSION::STRING < '5'
|
12
|
-
assert_select 'select option[value=Brazil]', 'Brazil'
|
13
|
-
end
|
9
|
+
assert_select 'select option[value=BR]', 'Brazil'
|
14
10
|
assert_no_select 'select option[value=""][disabled=disabled]'
|
15
11
|
end
|
16
12
|
|
17
13
|
test 'input generates a country select with SimpleForm default' do
|
18
14
|
swap SimpleForm, country_priority: [ 'Brazil' ] do
|
19
15
|
with_input_for @user, :country, :country
|
20
|
-
|
21
|
-
assert_select 'select option[value="---------------"][disabled=disabled]'
|
22
|
-
elsif ActionPack::VERSION::STRING < '5'
|
23
|
-
assert_select 'select option[value=""][disabled=disabled]'
|
24
|
-
end
|
16
|
+
assert_select 'select option[value="---------------"][disabled=disabled]'
|
25
17
|
end
|
26
18
|
end
|
27
19
|
|
@@ -44,15 +36,15 @@ class PriorityInputTest < ActionView::TestCase
|
|
44
36
|
assert_no_select 'select option[value=""]', /^$/
|
45
37
|
end
|
46
38
|
|
47
|
-
test 'priority input does
|
39
|
+
test 'priority input does generate select element with required html attribute' do
|
48
40
|
with_input_for @user, :country, :country
|
49
41
|
assert_select 'select.required'
|
50
|
-
|
42
|
+
assert_select 'select[required]'
|
51
43
|
end
|
52
44
|
|
53
|
-
test 'priority input does
|
45
|
+
test 'priority input does generate select element with aria-required html attribute' do
|
54
46
|
with_input_for @user, :country, :country
|
55
47
|
assert_select 'select.required'
|
56
|
-
|
48
|
+
assert_select 'select[aria-required]'
|
57
49
|
end
|
58
50
|
end
|
@@ -8,6 +8,11 @@ class StringInputTest < ActionView::TestCase
|
|
8
8
|
assert_select "input#user_name[type=text][name='user[name]'][value='New in SimpleForm!']"
|
9
9
|
end
|
10
10
|
|
11
|
+
test 'input maps text field to citext attribute' do
|
12
|
+
with_input_for @user, :name, :citext
|
13
|
+
assert_select "input#user_name[type=text][name='user[name]'][value='New in SimpleForm!']"
|
14
|
+
end
|
15
|
+
|
11
16
|
test 'input generates a password field for password attributes' do
|
12
17
|
with_input_for @user, :password, :password
|
13
18
|
assert_select "input#user_password.password[type=password][name='user[password]']"
|
@@ -38,18 +43,6 @@ class StringInputTest < ActionView::TestCase
|
|
38
43
|
assert_select 'input.string[minlength="5"]'
|
39
44
|
end
|
40
45
|
|
41
|
-
if ActionPack::VERSION::STRING < '5'
|
42
|
-
test 'input does not get maxlength from validation when tokenizer present' do
|
43
|
-
with_input_for @validating_user, :action, :string
|
44
|
-
assert_no_select 'input.string[maxlength]'
|
45
|
-
end
|
46
|
-
|
47
|
-
test 'input does not get minlength from validation when tokenizer present' do
|
48
|
-
with_input_for @validating_user, :action, :string
|
49
|
-
assert_no_select 'input.string[minlength]'
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
46
|
test 'input gets maxlength from validation when :is option present' do
|
54
47
|
with_input_for @validating_user, :home_picture, :string
|
55
48
|
assert_select 'input.string[maxlength="12"]'
|
@@ -88,12 +81,12 @@ class StringInputTest < ActionView::TestCase
|
|
88
81
|
|
89
82
|
test 'input infers pattern from attributes' do
|
90
83
|
with_input_for @other_validating_user, :country, :string, pattern: true
|
91
|
-
assert_select '
|
84
|
+
assert_select "input:match('pattern', ?)", /\w+/
|
92
85
|
end
|
93
86
|
|
94
87
|
test 'input infers pattern from attributes using proc' do
|
95
88
|
with_input_for @other_validating_user, :name, :string, pattern: true
|
96
|
-
assert_select '
|
89
|
+
assert_select "input:match('pattern', ?)", /\w+/
|
97
90
|
end
|
98
91
|
|
99
92
|
test 'input does not infer pattern from attributes if root default is false' do
|
@@ -105,7 +98,7 @@ class StringInputTest < ActionView::TestCase
|
|
105
98
|
|
106
99
|
test 'input uses given pattern from attributes' do
|
107
100
|
with_input_for @other_validating_user, :country, :string, input_html: { pattern: "\\d+" }
|
108
|
-
assert_select '
|
101
|
+
assert_select "input:match('pattern', ?)", /\\d+/
|
109
102
|
end
|
110
103
|
|
111
104
|
test 'input does not use pattern if model has :without validation option' do
|
@@ -37,6 +37,13 @@ class CollectionSelectInput < SimpleForm::Inputs::CollectionSelectInput
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
class FileInput < SimpleForm::Inputs::FileInput
|
41
|
+
def input_html_classes
|
42
|
+
super.delete_if { |html_class| html_class == :file }
|
43
|
+
super.push('file-upload')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
40
47
|
module CustomInputs
|
41
48
|
class CustomizedInput < SimpleForm::Inputs::StringInput
|
42
49
|
def input_html_classes
|
@@ -255,6 +255,12 @@ module MiscHelpers
|
|
255
255
|
f.input(attribute_name, options.merge(as: type))
|
256
256
|
end
|
257
257
|
end
|
258
|
+
|
259
|
+
def with_input_field_for(object, *args)
|
260
|
+
with_concat_form_for(object) do |f|
|
261
|
+
f.input_field(*args)
|
262
|
+
end
|
263
|
+
end
|
258
264
|
end
|
259
265
|
|
260
266
|
class CustomFormBuilder < SimpleForm::FormBuilder
|
data/test/support/models.rb
CHANGED
@@ -76,7 +76,11 @@ Friend = Struct.new(:id, :name) do
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
|
-
class Tag < Company
|
79
|
+
class Tag < Company
|
80
|
+
def group_method
|
81
|
+
["category-1"]
|
82
|
+
end
|
83
|
+
end
|
80
84
|
|
81
85
|
TagGroup = Struct.new(:id, :name, :tags)
|
82
86
|
|
@@ -91,7 +95,7 @@ class User
|
|
91
95
|
:post_count, :lock_version, :amount, :attempts, :action, :credit_card, :gender,
|
92
96
|
:extra_special_company_id, :pictures, :picture_ids, :special_pictures,
|
93
97
|
:special_picture_ids, :uuid, :friends, :friend_ids, :special_tags, :special_tag_ids,
|
94
|
-
:citext, :hstore, :json, :jsonb
|
98
|
+
:citext, :hstore, :json, :jsonb, :hourly, :favorite_color
|
95
99
|
|
96
100
|
def self.build(extra_attributes = {})
|
97
101
|
attributes = {
|
@@ -200,7 +204,7 @@ class User
|
|
200
204
|
|
201
205
|
def self.human_attribute_name(attribute, options = {})
|
202
206
|
case attribute
|
203
|
-
when 'name'
|
207
|
+
when 'name', :name
|
204
208
|
'Super User Name!'
|
205
209
|
when 'description'
|
206
210
|
'User Description!'
|
@@ -277,9 +281,6 @@ class ValidatingUser < User
|
|
277
281
|
only_integer: true
|
278
282
|
validates_length_of :name, maximum: 25, minimum: 5
|
279
283
|
validates_length_of :description, in: 15..50
|
280
|
-
if ActionPack::VERSION::STRING < '5'
|
281
|
-
validates_length_of :action, maximum: 10, tokenizer: ->(str) { str.scan(/\w+/) }
|
282
|
-
end
|
283
284
|
validates_length_of :home_picture, is: 12
|
284
285
|
|
285
286
|
def min_amount
|
@@ -332,3 +333,21 @@ end
|
|
332
333
|
|
333
334
|
class UserNumber1And2 < User
|
334
335
|
end
|
336
|
+
|
337
|
+
class UserWithAttachment < User
|
338
|
+
def avatar_attachment
|
339
|
+
OpenStruct.new
|
340
|
+
end
|
341
|
+
|
342
|
+
def cover_url
|
343
|
+
"/uploads/cover.png"
|
344
|
+
end
|
345
|
+
|
346
|
+
def profile_image_attacher
|
347
|
+
OpenStruct.new
|
348
|
+
end
|
349
|
+
|
350
|
+
def portrait_file_name
|
351
|
+
"portrait.png"
|
352
|
+
end
|
353
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'bundler/setup'
|
3
|
-
|
4
2
|
require 'minitest/autorun'
|
5
3
|
|
6
4
|
require 'active_model'
|
7
5
|
require 'action_controller'
|
8
6
|
require 'action_view'
|
7
|
+
|
9
8
|
ActionView::RoutingUrlFor.send(:include, ActionDispatch::Routing::UrlFor)
|
10
9
|
|
11
10
|
require 'action_view/template'
|
12
|
-
|
13
11
|
require 'action_view/test_case'
|
14
12
|
|
15
13
|
module Rails
|
@@ -41,10 +39,14 @@ if ActiveSupport::TestCase.respond_to?(:test_order=)
|
|
41
39
|
ActiveSupport::TestCase.test_order = :random
|
42
40
|
end
|
43
41
|
|
42
|
+
require "rails/test_unit/line_filtering"
|
43
|
+
|
44
44
|
class ActionView::TestCase
|
45
45
|
include MiscHelpers
|
46
46
|
include SimpleForm::ActionViewExtensions::FormHelper
|
47
47
|
|
48
|
+
extend Rails::LineFiltering
|
49
|
+
|
48
50
|
setup :set_controller
|
49
51
|
setup :setup_users
|
50
52
|
|
@@ -89,4 +91,5 @@ class ActionView::TestCase
|
|
89
91
|
alias :validating_user_path :user_path
|
90
92
|
alias :validating_users_path :user_path
|
91
93
|
alias :other_validating_user_path :user_path
|
94
|
+
alias :user_with_attachment_path :user_path
|
92
95
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Valim
|
@@ -10,36 +10,36 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-09-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - "
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '5.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- - "
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
28
|
+
version: '5.0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: actionpack
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- - "
|
33
|
+
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
35
|
+
version: '5.0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- - "
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '5.0'
|
43
43
|
description: Forms made easy!
|
44
44
|
email: opensource@plataformatec.com.br
|
45
45
|
executables: []
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/simple_form/inputs/collection_input.rb
|
92
92
|
- lib/simple_form/inputs/collection_radio_buttons_input.rb
|
93
93
|
- lib/simple_form/inputs/collection_select_input.rb
|
94
|
+
- lib/simple_form/inputs/color_input.rb
|
94
95
|
- lib/simple_form/inputs/date_time_input.rb
|
95
96
|
- lib/simple_form/inputs/file_input.rb
|
96
97
|
- lib/simple_form/inputs/grouped_collection_select_input.rb
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- test/inputs/collection_check_boxes_input_test.rb
|
130
131
|
- test/inputs/collection_radio_buttons_input_test.rb
|
131
132
|
- test/inputs/collection_select_input_test.rb
|
133
|
+
- test/inputs/color_input_test.rb
|
132
134
|
- test/inputs/datetime_input_test.rb
|
133
135
|
- test/inputs/disabled_test.rb
|
134
136
|
- test/inputs/discovery_test.rb
|
@@ -167,46 +169,47 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
169
|
- !ruby/object:Gem::Version
|
168
170
|
version: '0'
|
169
171
|
requirements: []
|
170
|
-
rubyforge_project:
|
171
|
-
rubygems_version: 2.
|
172
|
+
rubyforge_project:
|
173
|
+
rubygems_version: 2.7.3
|
172
174
|
signing_key:
|
173
175
|
specification_version: 4
|
174
176
|
summary: Forms made easy!
|
175
177
|
test_files:
|
176
|
-
- test/action_view_extensions/builder_test.rb
|
177
|
-
- test/action_view_extensions/form_helper_test.rb
|
178
|
-
- test/components/custom_components_test.rb
|
179
178
|
- test/components/label_test.rb
|
180
|
-
- test/
|
181
|
-
- test/
|
182
|
-
- test/
|
179
|
+
- test/components/custom_components_test.rb
|
180
|
+
- test/support/discovery_inputs.rb
|
181
|
+
- test/support/misc_helpers.rb
|
182
|
+
- test/support/mock_controller.rb
|
183
|
+
- test/support/models.rb
|
184
|
+
- test/test_helper.rb
|
183
185
|
- test/form_builder/error_test.rb
|
184
|
-
- test/form_builder/general_test.rb
|
185
186
|
- test/form_builder/hint_test.rb
|
187
|
+
- test/form_builder/error_notification_test.rb
|
188
|
+
- test/form_builder/general_test.rb
|
189
|
+
- test/form_builder/button_test.rb
|
186
190
|
- test/form_builder/input_field_test.rb
|
187
191
|
- test/form_builder/label_test.rb
|
188
192
|
- test/form_builder/wrapper_test.rb
|
193
|
+
- test/form_builder/association_test.rb
|
189
194
|
- test/generators/simple_form_generator_test.rb
|
190
|
-
- test/
|
195
|
+
- test/action_view_extensions/builder_test.rb
|
196
|
+
- test/action_view_extensions/form_helper_test.rb
|
197
|
+
- test/simple_form_test.rb
|
198
|
+
- test/inputs/string_input_test.rb
|
199
|
+
- test/inputs/numeric_input_test.rb
|
200
|
+
- test/inputs/readonly_test.rb
|
201
|
+
- test/inputs/grouped_collection_select_input_test.rb
|
202
|
+
- test/inputs/text_input_test.rb
|
191
203
|
- test/inputs/collection_check_boxes_input_test.rb
|
192
|
-
- test/inputs/
|
193
|
-
- test/inputs/collection_select_input_test.rb
|
194
|
-
- test/inputs/datetime_input_test.rb
|
204
|
+
- test/inputs/boolean_input_test.rb
|
195
205
|
- test/inputs/disabled_test.rb
|
196
206
|
- test/inputs/discovery_test.rb
|
197
|
-
- test/inputs/
|
207
|
+
- test/inputs/collection_select_input_test.rb
|
198
208
|
- test/inputs/general_test.rb
|
199
|
-
- test/inputs/
|
200
|
-
- test/inputs/hidden_input_test.rb
|
201
|
-
- test/inputs/numeric_input_test.rb
|
202
|
-
- test/inputs/priority_input_test.rb
|
203
|
-
- test/inputs/readonly_test.rb
|
209
|
+
- test/inputs/color_input_test.rb
|
204
210
|
- test/inputs/required_test.rb
|
205
|
-
- test/inputs/
|
206
|
-
- test/inputs/
|
207
|
-
- test/
|
208
|
-
- test/
|
209
|
-
- test/
|
210
|
-
- test/support/mock_controller.rb
|
211
|
-
- test/support/models.rb
|
212
|
-
- test/test_helper.rb
|
211
|
+
- test/inputs/collection_radio_buttons_input_test.rb
|
212
|
+
- test/inputs/priority_input_test.rb
|
213
|
+
- test/inputs/hidden_input_test.rb
|
214
|
+
- test/inputs/file_input_test.rb
|
215
|
+
- test/inputs/datetime_input_test.rb
|