diff --git a/app/helpers/spree/api/api_helpers.rb b/app/helpers/spree/api/api_helpers.rb index 5341d92d2f..094d726336 100644 --- a/app/helpers/spree/api/api_helpers.rb +++ b/app/helpers/spree/api/api_helpers.rb @@ -12,7 +12,8 @@ module Spree end def product_attributes - [:id, :name, :description, :price, :available_on, :permalink, :meta_description, :meta_keywords, :shipping_category_id, :taxon_ids] + [:id, :name, :description, :price, :available_on, :permalink, :meta_description, + :meta_keywords, :shipping_category_id, :taxon_ids] end def product_property_attributes @@ -20,11 +21,13 @@ module Spree end def variant_attributes - [:id, :name, :sku, :price, :weight, :height, :width, :depth, :is_master, :cost_price, :permalink] + [:id, :name, :sku, :price, :weight, :height, :width, :depth, + :is_master, :cost_price, :permalink] end def image_attributes - [:id, :position, :attachment_content_type, :attachment_file_name, :type, :attachment_updated_at, :attachment_width, :attachment_height, :alt] + [:id, :position, :attachment_content_type, :attachment_file_name, + :type, :attachment_updated_at, :attachment_width, :attachment_height, :alt] end def option_value_attributes @@ -32,7 +35,9 @@ module Spree end def order_attributes - [:id, :number, :item_total, :total, :state, :adjustment_total, :user_id, :created_at, :updated_at, :completed_at, :payment_total, :shipment_state, :payment_state, :email, :special_instructions, :token] + [:id, :number, :item_total, :total, :state, :adjustment_total, :user_id, + :created_at, :updated_at, :completed_at, :payment_total, + :shipment_state, :payment_state, :email, :special_instructions, :token] end def line_item_attributes @@ -44,7 +49,8 @@ module Spree end def payment_attributes - [:id, :source_type, :source_id, :amount, :payment_method_id, :response_code, :state, :avs_response, :created_at, :updated_at] + [:id, :source_type, :source_id, :amount, :payment_method_id, + :response_code, :state, :avs_response, :created_at, :updated_at] end def payment_method_attributes @@ -80,11 +86,13 @@ module Spree end def adjustment_attributes - [:id, :source_type, :source_id, :adjustable_type, :adjustable_id, :originator_type, :originator_id, :amount, :label, :mandatory, :locked, :eligible, :created_at, :updated_at] + [:id, :source_type, :source_id, :adjustable_type, :adjustable_id, :originator_type, + :originator_id, :amount, :label, :mandatory, :locked, :eligible, :created_at, :updated_at] end def creditcard_attributes - [:id, :month, :year, :cc_type, :last_digits, :first_name, :last_name, :gateway_customer_profile_id, :gateway_payment_profile_id] + [:id, :month, :year, :cc_type, :last_digits, :first_name, :last_name, + :gateway_customer_profile_id, :gateway_payment_profile_id] end def user_attributes @@ -96,7 +104,8 @@ module Spree end def stock_location_attributes - [:id, :name, :address1, :address2, :city, :state_id, :state_name, :country_id, :zipcode, :phone, :active] + [:id, :name, :address1, :address2, :city, + :state_id, :state_name, :country_id, :zipcode, :phone, :active] end def stock_movement_attributes diff --git a/spec/controllers/spree/admin/products_controller_spec.rb b/spec/controllers/spree/admin/products_controller_spec.rb index 2f02e0215f..51c6983527 100644 --- a/spec/controllers/spree/admin/products_controller_spec.rb +++ b/spec/controllers/spree/admin/products_controller_spec.rb @@ -150,15 +150,16 @@ describe Spree::Admin::ProductsController, type: :controller do describe "when user uploads an image in an unsupported format" do it "does not throw an exception" do - product_image = ActionDispatch::Http::UploadedFile.new({ - :filename => 'unsupported_image_format.exr', - :content_type => 'application/octet-stream', - :tempfile => Tempfile.new('unsupported_image_format.exr') - }) + product_image = ActionDispatch::Http::UploadedFile.new( + filename: 'unsupported_image_format.exr', + content_type: 'application/octet-stream', + tempfile: Tempfile.new('unsupported_image_format.exr') + ) product_attrs_with_image = product_attrs.merge( images_attributes: { '0' => { attachment: product_image } - }) + } + ) expect do spree_put :create, product: product_attrs_with_image diff --git a/spec/features/admin/reports/packing_report_spec.rb b/spec/features/admin/reports/packing_report_spec.rb index e6af4e84bb..9ab6ff1150 100644 --- a/spec/features/admin/reports/packing_report_spec.rb +++ b/spec/features/admin/reports/packing_report_spec.rb @@ -27,7 +27,7 @@ feature "Packing Reports", js: true do select oc.name, from: "q_order_cycle_id_in" find('#q_completed_at_gt').click - select_date(Time.zone.today - 1.days) + select_date(Time.zone.today - 1.day) find('#q_completed_at_lt').click select_date(Time.zone.today) diff --git a/spec/models/product_importer_spec.rb b/spec/models/product_importer_spec.rb index d0487192c1..582297195d 100644 --- a/spec/models/product_importer_spec.rb +++ b/spec/models/product_importer_spec.rb @@ -250,7 +250,7 @@ describe ProductImport::ProductImporter do describe "updating an exiting variant" do let(:csv_data) { CSV.generate do |csv| - csv << ["name", "producer", "description" ,"category", "on_hand", "price", "units", "unit_type", "display_name", "shipping_category"] + csv << ["name", "producer", "description", "category", "on_hand", "price", "units", "unit_type", "display_name", "shipping_category"] csv << ["Hypothetical Cake", "Another Enterprise", "New Description", "Cake", "5", "5.50", "500", "g", "Preexisting Banana", shipping_category.name] end } @@ -530,7 +530,6 @@ describe ProductImport::ProductImporter do } let(:importer) { import_data csv_data, import_into: 'inventories' } - it "updates inventory item correctly" do importer.save_entries @@ -548,8 +547,8 @@ describe ProductImport::ProductImporter do let!(:inventory) { InventoryItem.create(variant_id: product4.variants.first.id, enterprise_id: enterprise2.id, visible: false) } let(:csv_data) { CSV.generate do |csv| - csv << ["name", "distributor", "producer", "on_hand", "price", "units", "variant_unit_name"] - csv << ["Cabbage", "Another Enterprise", "User Enterprise", "900", "", "1", "Whole"] + csv << ["name", "distributor", "producer", "on_hand", "price", "units", "variant_unit_name"] + csv << ["Cabbage", "Another Enterprise", "User Enterprise", "900", "", "1", "Whole"] end } let(:importer) { import_data csv_data, import_into: 'inventories' }