Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #1849

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ See http://blog.plataformatec.com.br/2019/09/incorrect-access-control-in-simple-
### Bug fix
* Fix horizontal form label position, from right to text-right. [@cavpollo](https://github.com/cavpollo)
* Add base error display alongside existing errors. [@bluefalcon26](https://github.com/bluefalcon26)
* Silent deprication warning for placeholder_text. [@moofkit](https://github.com/moofkit)
* Silent deprecation warning for placeholder_text. [@moofkit](https://github.com/moofkit)
* Use custom i18n scope for label required html. [@tvdeyen](https://github.com/tvdeyen)

## 3.5.1
Expand Down Expand Up @@ -232,7 +232,7 @@ See http://blog.plataformatec.com.br/2019/09/incorrect-access-control-in-simple-

### bug fix
* Fix `full_error` when the attribute is an association. [@mvdamme](https://github.com/jorge-d)
* Fix suppport to `:namespace` and `:index` options for nested check boxes and radio buttons when the attribute is an association.
* Fix support to `:namespace` and `:index` options for nested check boxes and radio buttons when the attribute is an association.
* Collection input that uses automatic collection translation properly sets checked values.
Closes [#971](https://github.com/heartcombo/simple_form/issues/971) [@nashby](https://github.com/nashby)
* Collection input generates `required` attribute if it has `prompt` option. [@nashby](https://github.com/nashby)
Expand Down
6 changes: 3 additions & 3 deletions lib/simple_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ def self.deprecator
mattr_accessor :error_notification_class
@@error_notification_class = :error_notification

# Series of attemps to detect a default label method for collection.
# Series of attempts to detect a default label method for collection.
mattr_accessor :collection_label_methods
@@collection_label_methods = %i[to_label name title to_s]

# Series of attemps to detect a default value method for collection.
# Series of attempts to detect a default value method for collection.
mattr_accessor :collection_value_methods
@@collection_value_methods = %i[id to_s]

Expand Down Expand Up @@ -178,7 +178,7 @@ def self.deprecator
mattr_accessor :cache_discovery
@@cache_discovery = defined?(Rails.env) && !Rails.env.development?

# Adds a class to each generated button, mostly for compatiblity.
# Adds a class to each generated button, mostly for compatibility.
mattr_accessor :button_class
@@button_class = 'button'

Expand Down
6 changes: 3 additions & 3 deletions test/action_view_extensions/builder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def with_collection_check_boxes(object, attribute, collection, value_method, tex
end
end
# COLLECTION CHECK BOX
test "collection check box accepts a collection and generate a serie of checkboxes for value method" do
test "collection check box accepts a collection and generate a series of checkboxes for value method" do
collection = [Tag.new(1, 'Tag 1'), Tag.new(2, 'Tag 2')]
with_collection_check_boxes @user, :tag_ids, collection, :id, :name

Expand All @@ -284,7 +284,7 @@ def with_collection_check_boxes(object, attribute, collection, value_method, tex
assert_select "form input[type=hidden][name='user[tag_ids][]'][value='']", count: 1
end

test "collection check box accepts a collection and generate a serie of checkboxes with labels for label method" do
test "collection check box accepts a collection and generate a series of checkboxes with labels for label method" do
collection = [Tag.new(1, 'Tag 1'), Tag.new(2, 'Tag 2')]
with_collection_check_boxes @user, :tag_ids, collection, :id, :name

Expand Down Expand Up @@ -585,7 +585,7 @@ def with_collection_check_boxes(object, attribute, collection, value_method, tex
end
end

test "fields for with a hash like model yeilds an instance of FormBuilder" do
test "fields for with a hash like model yields an instance of FormBuilder" do
with_concat_form_for(:user) do |f|
f.simple_fields_for(:author, HashBackedAuthor.new) do |author|
assert author.instance_of?(SimpleForm::FormBuilder)
Expand Down
2 changes: 1 addition & 1 deletion test/form_builder/label_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def with_label_for(object, *args, &block)
end
end

test 'configuration allow set rewrited label tag for wrappers' do
test 'configuration allow set rewritten label tag for wrappers' do
swap_wrapper :default, custom_wrapper_with_custom_label_component do
with_concat_form_for(@user) do |f|
concat f.input :age
Expand Down
4 changes: 2 additions & 2 deletions test/inputs/collection_select_input_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ class CollectionSelectInputTest < ActionView::TestCase
assert_select 'select option[value="2"]', 'Carlos'
end

test 'input disables the anothers components when the option is a object' do
test 'input disables all options when the entire select is disabled' do
with_input_for @user, :description, :select, collection: %w[Jose Carlos], disabled: true
assert_no_select 'select option[value=Jose][disabled=disabled]', 'Jose'
assert_no_select 'select option[value=Carlos][disabled=disabled]', 'Carlos'
assert_select 'select[disabled=disabled]'
assert_select 'div.disabled'
end

test 'input does not disable the anothers components when the option is a object' do
test 'input disables only specific options when individual options are disabled' do
Comment on lines +223 to +231
Copy link
Author

@tagliala tagliala Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about those two

with_input_for @user, :description, :select, collection: %w[Jose Carlos], disabled: 'Jose'
assert_select 'select option[value=Jose][disabled=disabled]', 'Jose'
assert_no_select 'select option[value=Carlos][disabled=disabled]', 'Carlos'
Expand Down
4 changes: 2 additions & 2 deletions test/inputs/discovery_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def discovery(value = false)
end
end

test 'builder discovers new maped inputs from configured namespaces if not cached' do
test 'builder discovers new mapped inputs from configured namespaces if not cached' do
discovery do
swap SimpleForm, custom_inputs_namespaces: ['CustomInputs'] do
with_form_for @user, :password
Expand All @@ -75,7 +75,7 @@ def discovery(value = false)
end
end

test 'builder discovers new maped inputs from configured namespaces before the ones from top level namespace' do
test 'builder discovers new mapped inputs from configured namespaces before the ones from top level namespace' do
discovery do
swap SimpleForm, custom_inputs_namespaces: ['CustomInputs'] do
with_form_for @user, :age
Expand Down