mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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:
@@ -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],
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user