Fix linter issues

Although I don't think the size was an issue here, small hashes can easily fit on one line.
This commit is contained in:
David Cook
2023-04-05 17:00:10 +10:00
parent 0f3e2ae572
commit 6570891349
2 changed files with 20 additions and 31 deletions

View File

@@ -80,35 +80,24 @@ module Spree
end
def preference_field_options(options)
field_options = case options[:type]
when :integer
{
size: 10,
class: 'input_integer',
step: 1,
}
when :decimal
{
size: 10,
class: 'input_integer',
step: :any, # Allow any number of decimal places
}
when :boolean
{}
when :string
{ size: 10,
class: 'input_string fullwidth' }
when :password
{ size: 10,
class: 'password_string fullwidth' }
when :text
{ rows: 15,
cols: 85,
class: 'fullwidth' }
else
{ size: 10,
class: 'input_string fullwidth' }
end
field_options =
case options[:type]
when :integer
{ size: 10, class: 'input_integer', step: 1 }
when :decimal
# Allow any number of decimal places
{ size: 10, class: 'input_integer', step: :any }
when :boolean
{}
when :string
{ size: 10, class: 'input_string fullwidth' }
when :password
{ size: 10, class: 'password_string fullwidth' }
when :text
{ rows: 15, cols: 85, class: 'fullwidth' }
else
{ size: 10, class: 'input_string fullwidth' }
end
field_options.merge!(
readonly: options[:readonly],

View File

@@ -441,7 +441,7 @@ describe '
expect(page).to have_field 'Amount', with: '10.0'
expect(page).not_to have_field 'payment_method_name', with: ''
expect(page).not_to have_field 'payment_method_description', with: 'Edited description'
expect(page).not_to have_unchecked_field "payment_method_distributor_ids_#{@distributors[0].id}"
expect(page).to have_checked_field "payment_method_distributor_ids_#{@distributors[0].id}"
end
end
@@ -508,7 +508,7 @@ describe '
expect(page).to have_field 'Amount', with: '10.0'
expect(page).not_to have_field 'payment_method_name', with: ''
expect(page).not_to have_field 'payment_method_description', with: 'Edited description'
expect(page).not_to have_unchecked_field "payment_method_distributor_ids_#{@distributors[0].id}"
expect(page).to have_checked_field "payment_method_distributor_ids_#{@distributors[0].id}"
end
end
end