simple_form 5.1.0 → 5.3.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 +4 -4
- data/CHANGELOG.md +16 -0
- data/MIT-LICENSE +1 -1
- data/README.md +64 -16
- data/lib/generators/simple_form/install_generator.rb +2 -2
- data/lib/generators/simple_form/templates/README +1 -1
- data/lib/generators/simple_form/templates/config/initializers/simple_form.rb +1 -1
- data/lib/generators/simple_form/templates/config/initializers/simple_form_bootstrap.rb +126 -194
- data/lib/simple_form/components/label_input.rb +1 -1
- data/lib/simple_form/form_builder.rb +2 -6
- data/lib/simple_form/inputs/boolean_input.rb +6 -2
- data/lib/simple_form/inputs/grouped_collection_select_input.rb +1 -1
- data/lib/simple_form/inputs/priority_input.rb +16 -2
- data/lib/simple_form/railtie.rb +4 -0
- data/lib/simple_form/version.rb +1 -1
- data/lib/simple_form/wrappers/leaf.rb +1 -1
- data/lib/simple_form.rb +9 -5
- metadata +11 -83
- data/test/action_view_extensions/builder_test.rb +0 -634
- data/test/action_view_extensions/form_helper_test.rb +0 -172
- data/test/components/custom_components_test.rb +0 -62
- data/test/components/label_test.rb +0 -352
- data/test/form_builder/association_test.rb +0 -252
- data/test/form_builder/button_test.rb +0 -48
- data/test/form_builder/error_notification_test.rb +0 -80
- data/test/form_builder/error_test.rb +0 -281
- data/test/form_builder/general_test.rb +0 -539
- data/test/form_builder/hint_test.rb +0 -150
- data/test/form_builder/input_field_test.rb +0 -195
- data/test/form_builder/label_test.rb +0 -136
- data/test/form_builder/wrapper_test.rb +0 -378
- data/test/generators/simple_form_generator_test.rb +0 -43
- data/test/inputs/boolean_input_test.rb +0 -243
- data/test/inputs/collection_check_boxes_input_test.rb +0 -323
- data/test/inputs/collection_radio_buttons_input_test.rb +0 -446
- data/test/inputs/collection_select_input_test.rb +0 -380
- data/test/inputs/color_input_test.rb +0 -10
- data/test/inputs/datetime_input_test.rb +0 -176
- data/test/inputs/disabled_test.rb +0 -92
- data/test/inputs/discovery_test.rb +0 -142
- data/test/inputs/file_input_test.rb +0 -17
- data/test/inputs/general_test.rb +0 -133
- data/test/inputs/grouped_collection_select_input_test.rb +0 -183
- data/test/inputs/hidden_input_test.rb +0 -32
- data/test/inputs/numeric_input_test.rb +0 -177
- data/test/inputs/priority_input_test.rb +0 -50
- data/test/inputs/readonly_test.rb +0 -102
- data/test/inputs/required_test.rb +0 -158
- data/test/inputs/rich_text_area_input_test.rb +0 -15
- data/test/inputs/string_input_test.rb +0 -158
- data/test/inputs/text_input_test.rb +0 -37
- data/test/simple_form_test.rb +0 -18
- data/test/support/discovery_inputs.rb +0 -65
- data/test/support/misc_helpers.rb +0 -274
- data/test/support/mock_controller.rb +0 -30
- data/test/support/models.rb +0 -357
- data/test/test_helper.rb +0 -95
data/test/test_helper.rb
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'minitest/autorun'
|
3
|
-
|
4
|
-
require 'active_model'
|
5
|
-
require 'action_controller'
|
6
|
-
require 'action_view'
|
7
|
-
|
8
|
-
ActionView::RoutingUrlFor.send(:include, ActionDispatch::Routing::UrlFor)
|
9
|
-
|
10
|
-
require 'action_view/template'
|
11
|
-
require 'action_view/test_case'
|
12
|
-
|
13
|
-
module Rails
|
14
|
-
def self.env
|
15
|
-
ActiveSupport::StringInquirer.new("test")
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
$:.unshift File.expand_path("../../lib", __FILE__)
|
20
|
-
require 'simple_form'
|
21
|
-
|
22
|
-
require "rails/generators/test_case"
|
23
|
-
require 'generators/simple_form/install_generator'
|
24
|
-
|
25
|
-
Dir["#{File.dirname(__FILE__)}/support/*.rb"].each do |file|
|
26
|
-
require file unless file.end_with?('discovery_inputs.rb')
|
27
|
-
end
|
28
|
-
I18n.default_locale = :en
|
29
|
-
|
30
|
-
require 'country_select'
|
31
|
-
|
32
|
-
if defined?(HTMLSelector::NO_STRIP)
|
33
|
-
HTMLSelector::NO_STRIP << "label"
|
34
|
-
else
|
35
|
-
ActionDispatch::Assertions::NO_STRIP << "label"
|
36
|
-
end
|
37
|
-
|
38
|
-
if ActiveSupport::TestCase.respond_to?(:test_order=)
|
39
|
-
ActiveSupport::TestCase.test_order = :random
|
40
|
-
end
|
41
|
-
|
42
|
-
require "rails/test_unit/line_filtering"
|
43
|
-
|
44
|
-
class ActionView::TestCase
|
45
|
-
include MiscHelpers
|
46
|
-
include SimpleForm::ActionViewExtensions::FormHelper
|
47
|
-
|
48
|
-
extend Rails::LineFiltering
|
49
|
-
|
50
|
-
setup :set_controller
|
51
|
-
setup :setup_users
|
52
|
-
|
53
|
-
def set_controller
|
54
|
-
@controller = MockController.new
|
55
|
-
end
|
56
|
-
|
57
|
-
def setup_users(extra_attributes = {})
|
58
|
-
@user = User.build(extra_attributes)
|
59
|
-
@decorated_user = Decorator.new(@user)
|
60
|
-
|
61
|
-
@validating_user = ValidatingUser.build({
|
62
|
-
name: 'Tester McTesterson',
|
63
|
-
description: 'A test user of the most distinguished caliber',
|
64
|
-
home_picture: 'Home picture',
|
65
|
-
age: 19,
|
66
|
-
amount: 15,
|
67
|
-
attempts: 1,
|
68
|
-
company: [1]
|
69
|
-
}.merge!(extra_attributes))
|
70
|
-
|
71
|
-
@other_validating_user = OtherValidatingUser.build({
|
72
|
-
age: 19,
|
73
|
-
company: 1
|
74
|
-
}.merge!(extra_attributes))
|
75
|
-
end
|
76
|
-
|
77
|
-
def protect_against_forgery?
|
78
|
-
false
|
79
|
-
end
|
80
|
-
|
81
|
-
def user_path(*args)
|
82
|
-
'/users'
|
83
|
-
end
|
84
|
-
|
85
|
-
def company_user_path(*args)
|
86
|
-
'/company/users'
|
87
|
-
end
|
88
|
-
|
89
|
-
alias :users_path :user_path
|
90
|
-
alias :super_user_path :user_path
|
91
|
-
alias :validating_user_path :user_path
|
92
|
-
alias :validating_users_path :user_path
|
93
|
-
alias :other_validating_user_path :user_path
|
94
|
-
alias :user_with_attachment_path :user_path
|
95
|
-
end
|