mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Style Rails/ToFormattedS
This commit is contained in:
@@ -1334,16 +1334,6 @@ Rails/TimeZone:
|
||||
- 'spec/models/spree/tax_rate_spec.rb'
|
||||
- 'spec/services/customer_order_cancellation_spec.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: to_fs, to_formatted_s
|
||||
Rails/ToFormattedS:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/variant_overrides_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'spec/system/admin/product_import_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
Rails/ToSWithArgument:
|
||||
|
||||
@@ -63,7 +63,7 @@ module Admin
|
||||
|
||||
options = [{ id: '0', name: 'All' }]
|
||||
import_dates.collect(&:import_date).map { |i|
|
||||
options.push(id: i.to_date, name: i.to_date.to_formatted_s(:long))
|
||||
options.push(id: i.to_date, name: i.to_date.to_fs(:long))
|
||||
}
|
||||
|
||||
options
|
||||
|
||||
@@ -177,7 +177,7 @@ module Spree
|
||||
def product_import_dates
|
||||
options = [{ id: '0', name: '' }]
|
||||
product_import_dates_query.collect(&:import_date).
|
||||
map { |i| options.push(id: i.to_date, name: i.to_date.to_formatted_s(:long)) }
|
||||
map { |i| options.push(id: i.to_date, name: i.to_date.to_fs(:long)) }
|
||||
|
||||
options
|
||||
end
|
||||
|
||||
@@ -233,7 +233,7 @@ describe "Product Import" do
|
||||
end
|
||||
|
||||
expect(page).to have_selector 'div#s2id_import_date_filter'
|
||||
import_time = carrots.import_date.to_date.to_formatted_s(:long).gsub(' ', ' ')
|
||||
import_time = carrots.import_date.to_date.to_fs(:long).gsub(' ', ' ')
|
||||
select2_select import_time, from: "import_date_filter"
|
||||
page.find('.button.icon-search').click
|
||||
|
||||
|
||||
Reference in New Issue
Block a user