solidus_core 1.4.2 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/models/concerns/spree/user_address_book.rb +1 -1
- data/app/models/spree/adjustment.rb +0 -19
- data/app/models/spree/credit_card.rb +6 -4
- data/app/models/spree/inventory_unit.rb +2 -2
- data/app/models/spree/item_adjustments.rb +5 -1
- data/app/models/spree/order/checkout.rb +1 -1
- data/app/models/spree/order/payments.rb +4 -0
- data/app/models/spree/order.rb +5 -19
- data/app/models/spree/order_capturing.rb +15 -8
- data/app/models/spree/order_contents.rb +1 -0
- data/app/models/spree/order_update_attributes.rb +0 -2
- data/app/models/spree/order_updater.rb +2 -2
- data/app/models/spree/payment.rb +3 -2
- data/app/models/spree/promotion/actions/create_adjustment.rb +2 -1
- data/app/models/spree/promotion/actions/create_item_adjustments.rb +2 -2
- data/app/models/spree/shipment.rb +1 -1
- data/app/models/spree/stock_transfer.rb +1 -1
- data/app/models/spree/tax/item_adjuster.rb +3 -2
- data/app/models/spree/tax/order_adjuster.rb +3 -0
- data/app/models/spree/tax_rate.rb +3 -3
- data/app/models/spree/transfer_item.rb +2 -2
- data/app/models/spree/unit_cancel.rb +2 -2
- data/db/migrate/20120831092320_spree_one_two.rb +2 -2
- data/db/migrate/20120831092359_spree_promo_one_two.rb +2 -2
- data/db/migrate/20120905145253_add_tax_rate_label.rb +1 -1
- data/db/migrate/20120905151823_add_toggle_tax_rate_display.rb +1 -1
- data/db/migrate/20120929093553_remove_unused_preference_columns.rb +1 -1
- data/db/migrate/20121009142519_add_lock_version_to_variant.rb +1 -1
- data/db/migrate/20121010142909_add_states_required_to_countries.rb +1 -1
- data/db/migrate/20121012071449_add_on_demand_to_product_and_variant.rb +1 -1
- data/db/migrate/20121017010007_remove_not_null_constraint_from_products_on_hand.rb +1 -1
- data/db/migrate/20121031162139_split_prices_from_variants.rb +1 -1
- data/db/migrate/20121107003422_remove_not_null_from_spree_prices_amount.rb +1 -1
- data/db/migrate/20121107184631_add_currency_to_line_items.rb +1 -1
- data/db/migrate/20121107194006_add_currency_to_orders.rb +1 -1
- data/db/migrate/20121109173623_add_cost_currency_to_variants.rb +1 -1
- data/db/migrate/20121111231553_remove_display_on_from_payment_methods.rb +1 -1
- data/db/migrate/20121124203911_add_position_to_taxonomies.rb +1 -1
- data/db/migrate/20121126040517_add_last_ip_to_spree_orders.rb +1 -1
- data/db/migrate/20121213162028_add_state_to_spree_adjustments.rb +1 -1
- data/db/migrate/20130114053446_add_display_on_to_spree_payment_methods.rb +1 -1
- data/db/migrate/20130120201805_add_position_to_product_properties.spree.rb +1 -1
- data/db/migrate/20130203232234_add_identifier_to_spree_payments.rb +1 -1
- data/db/migrate/20130207155350_add_order_id_index_to_payments.rb +1 -1
- data/db/migrate/20130208032954_add_primary_to_spree_products_taxons.rb +1 -1
- data/db/migrate/20130211190146_create_spree_stock_items.rb +1 -1
- data/db/migrate/20130211191120_create_spree_stock_locations.rb +1 -1
- data/db/migrate/20130213191427_create_default_stock.rb +1 -1
- data/db/migrate/20130222032153_add_order_id_index_to_shipments.rb +1 -1
- data/db/migrate/20130226032817_change_meta_description_on_spree_products_to_text.rb +1 -1
- data/db/migrate/20130226191231_add_stock_location_id_to_spree_shipments.rb +1 -1
- data/db/migrate/20130227143905_add_pending_to_inventory_unit.rb +1 -1
- data/db/migrate/20130228164411_remove_on_demand_from_product_and_variant.rb +1 -1
- data/db/migrate/20130228210442_create_shipping_method_zone.rb +1 -1
- data/db/migrate/20130301162745_remove_shipping_category_id_from_shipping_method.rb +1 -1
- data/db/migrate/20130301162924_create_shipping_method_categories.rb +1 -1
- data/db/migrate/20130301205200_add_tracking_url_to_spree_shipping_methods.rb +1 -1
- data/db/migrate/20130304162240_create_spree_shipping_rates.rb +1 -1
- data/db/migrate/20130304192936_remove_category_match_attributes_from_shipping_method.rb +1 -1
- data/db/migrate/20130305143310_create_stock_movements.rb +1 -1
- data/db/migrate/20130306181701_add_address_fields_to_stock_location.rb +1 -1
- data/db/migrate/20130306191917_add_active_field_to_stock_locations.rb +1 -1
- data/db/migrate/20130306195650_add_backorderable_to_stock_item.rb +1 -1
- data/db/migrate/20130307161754_add_default_quantity_to_stock_movement.rb +1 -1
- data/db/migrate/20130318151756_add_source_and_destination_to_stock_movements.rb +1 -1
- data/db/migrate/20130319062004_change_orders_total_precision.rb +1 -1
- data/db/migrate/20130319063911_change_spree_payments_amount_precision.rb +1 -1
- data/db/migrate/20130319064308_change_spree_return_authorization_amount_precision.rb +1 -1
- data/db/migrate/20130319082943_change_adjustments_amount_precision.rb +1 -1
- data/db/migrate/20130319183250_add_originator_to_stock_movement.rb +1 -1
- data/db/migrate/20130319190507_drop_source_and_destination_from_stock_movement.rb +1 -1
- data/db/migrate/20130325163316_migrate_inventory_unit_sold_to_on_hand.rb +1 -1
- data/db/migrate/20130326175857_add_stock_location_to_rma.rb +1 -1
- data/db/migrate/20130328130308_update_shipment_state_for_canceled_orders.rb +1 -1
- data/db/migrate/20130328195253_add_seo_metas_to_taxons.rb +1 -1
- data/db/migrate/20130329134939_remove_stock_item_and_variant_lock.rb +1 -1
- data/db/migrate/20130413230529_add_name_to_spree_credit_cards.rb +1 -1
- data/db/migrate/20130414000512_update_name_fields_on_spree_credit_cards.rb +1 -1
- data/db/migrate/20130417120034_add_index_to_source_columns_on_adjustments.rb +1 -1
- data/db/migrate/20130417120035_update_adjustment_states.rb +1 -1
- data/db/migrate/20130417123427_add_shipping_rates_to_shipments.rb +1 -1
- data/db/migrate/20130418125341_create_spree_stock_transfers.rb +1 -1
- data/db/migrate/20130423110707_drop_products_count_on_hand.rb +1 -1
- data/db/migrate/20130423223847_set_default_shipping_rate_cost.rb +1 -1
- data/db/migrate/20130509115210_add_number_to_stock_transfer.rb +1 -1
- data/db/migrate/20130514151929_add_sku_index_to_spree_variants.rb +1 -1
- data/db/migrate/20130515180736_add_backorderable_default_to_spree_stock_location.rb +1 -1
- data/db/migrate/20130516151222_add_propage_all_variants_to_spree_stock_location.rb +1 -1
- data/db/migrate/20130611054351_rename_shipping_methods_zones_to_spree_shipping_methods_zones.rb +1 -1
- data/db/migrate/20130611185927_add_user_id_index_to_spree_orders.rb +1 -1
- data/db/migrate/20130618041418_add_updated_at_to_spree_countries.rb +1 -1
- data/db/migrate/20130619012236_add_updated_at_to_spree_states.rb +1 -1
- data/db/migrate/20130626232741_add_cvv_result_code_and_cvv_result_message_to_spree_payments.rb +1 -1
- data/db/migrate/20130628021056_add_unique_index_to_permalink_on_spree_products.rb +1 -1
- data/db/migrate/20130628022817_add_unique_index_to_orders_shipments_and_stock_transfers.rb +1 -1
- data/db/migrate/20130708052307_add_deleted_at_to_spree_tax_rates.rb +1 -1
- data/db/migrate/20130711200933_remove_lock_version_from_inventory_units.rb +1 -1
- data/db/migrate/20130718042445_add_cost_price_to_line_item.rb +1 -1
- data/db/migrate/20130718233855_set_backorderable_to_default_to_false.rb +1 -1
- data/db/migrate/20130725031716_add_created_by_id_to_spree_orders.rb +1 -1
- data/db/migrate/20130729214043_index_completed_at_on_spree_orders.rb +1 -1
- data/db/migrate/20130802014537_add_tax_category_id_to_spree_line_items.rb +1 -1
- data/db/migrate/20130802022321_migrate_tax_categories_to_line_items.rb +1 -1
- data/db/migrate/20130806022521_drop_spree_mail_methods.rb +1 -1
- data/db/migrate/20130806145853_set_default_stock_location_on_shipments.rb +1 -1
- data/db/migrate/20130807024301_upgrade_adjustments.rb +1 -1
- data/db/migrate/20130807024302_rename_adjustment_fields.rb +1 -1
- data/db/migrate/20130809164245_add_admin_name_column_to_spree_shipping_methods.rb +1 -1
- data/db/migrate/20130809164330_add_admin_name_column_to_spree_stock_locations.rb +1 -1
- data/db/migrate/20130813004002_add_shipment_total_to_spree_orders.rb +1 -1
- data/db/migrate/20130813140619_expand_order_number_size.rb +1 -1
- data/db/migrate/20130813232134_rename_activators_to_promotions.rb +1 -1
- data/db/migrate/20130815000406_add_adjustment_total_to_line_items.rb +1 -1
- data/db/migrate/20130815024413_add_adjustment_total_to_shipments.rb +1 -1
- data/db/migrate/20130826062534_add_depth_to_spree_taxons.rb +1 -1
- data/db/migrate/20130828234942_add_tax_total_to_line_items_shipments_and_orders.rb +1 -1
- data/db/migrate/20130830001033_add_shipping_category_to_shipping_methods_and_products.rb +1 -1
- data/db/migrate/20130830001159_migrate_old_shipping_calculators.rb +1 -1
- data/db/migrate/20130903183026_add_code_to_spree_promotion_rules.rb +1 -1
- data/db/migrate/20130909115621_change_states_required_for_countries.rb +1 -1
- data/db/migrate/20130915032339_add_deleted_at_to_spree_stock_items.rb +1 -1
- data/db/migrate/20130917024658_remove_promotions_event_name_field.rb +1 -1
- data/db/migrate/20130924040529_add_promo_total_to_line_items_and_shipments_and_orders.rb +1 -1
- data/db/migrate/20131001013410_remove_unused_credit_card_fields.rb +1 -1
- data/db/migrate/20131026154747_add_track_inventory_to_variant.rb +1 -1
- data/db/migrate/20131107132123_add_tax_category_to_variants.rb +1 -1
- data/db/migrate/20131113035136_add_channel_to_spree_orders.rb +1 -1
- data/db/migrate/20131118043959_add_included_to_adjustments.rb +1 -1
- data/db/migrate/20131118050234_rename_tax_total_fields.rb +1 -1
- data/db/migrate/20131118183431_add_line_item_id_to_spree_inventory_units.rb +1 -1
- data/db/migrate/20131120234456_add_updated_at_to_variants.rb +1 -1
- data/db/migrate/20131127001002_add_position_to_classifications.rb +1 -1
- data/db/migrate/20131211112807_create_spree_orders_promotions.rb +1 -1
- data/db/migrate/20131211192741_unique_shipping_method_categories.rb +1 -1
- data/db/migrate/20131218054603_add_item_count_to_spree_orders.rb +1 -1
- data/db/migrate/20140106065820_remove_value_type_from_spree_preferences.rb +1 -1
- data/db/migrate/20140106224208_rename_permalink_to_slug_for_products.rb +1 -1
- data/db/migrate/20140120160805_add_index_to_variant_id_and_currency_on_prices.rb +1 -1
- data/db/migrate/20140124023232_rename_activator_id_in_rules_and_actions_to_promotion_id.rb +1 -1
- data/db/migrate/20140129024326_add_deleted_at_to_spree_prices.rb +1 -1
- data/db/migrate/20140203161722_add_approver_id_and_approved_at_to_orders.rb +1 -1
- data/db/migrate/20140204115338_add_confirmation_delivered_to_spree_orders.rb +1 -1
- data/db/migrate/20140204192230_add_auto_capture_to_payment_methods.rb +1 -1
- data/db/migrate/20140205120320_create_spree_payment_capture_events.rb +1 -1
- data/db/migrate/20140205144710_add_uncaptured_amount_to_payments.rb +1 -1
- data/db/migrate/20140205181631_default_variant_weight_to_zero.rb +1 -1
- data/db/migrate/20140207085910_add_tax_category_id_to_shipping_methods.rb +1 -1
- data/db/migrate/20140207093021_add_tax_rate_id_to_shipping_rates.rb +1 -1
- data/db/migrate/20140211040159_add_pre_tax_amount_to_line_items_and_shipments.rb +1 -1
- data/db/migrate/20140213184916_add_more_indexes.rb +1 -1
- data/db/migrate/20140219060952_add_considered_risky_to_orders.rb +1 -1
- data/db/migrate/20140227112348_add_preference_store_to_everything.rb +1 -1
- data/db/migrate/20140307235515_add_user_id_to_spree_credit_cards.rb +1 -1
- data/db/migrate/20140309023735_migrate_old_preferences.rb +1 -1
- data/db/migrate/20140309024355_create_spree_stores.rb +2 -2
- data/db/migrate/20140309033438_create_store_from_preferences.rb +1 -1
- data/db/migrate/20140315053743_add_timestamps_to_spree_assets.rb +1 -1
- data/db/migrate/20140318191500_create_spree_taxons_promotion_rules.rb +1 -1
- data/db/migrate/20140331100557_add_additional_store_fields.rb +1 -1
- data/db/migrate/20140410141842_add_many_missing_indexes.rb +1 -1
- data/db/migrate/20140410150358_correct_some_polymorphic_index_and_add_more_missing.rb +1 -1
- data/db/migrate/20140415041315_add_user_id_created_by_id_index_to_order.rb +1 -1
- data/db/migrate/20140508151342_change_spree_price_amount_precision.rb +1 -1
- data/db/migrate/20140518174634_add_token_to_spree_orders.rb +1 -1
- data/db/migrate/20140530024945_move_order_token_from_tokenized_permission.rb +1 -1
- data/db/migrate/20140601011216_set_shipment_total_for_users_upgrading.rb +1 -1
- data/db/migrate/20140604135309_drop_credit_card_first_name_and_last_name.rb +1 -1
- data/db/migrate/20140609201656_add_deleted_at_to_spree_promotion_actions.rb +1 -1
- data/db/migrate/20140616202624_remove_uncaptured_amount_from_spree_payments.rb +1 -1
- data/db/migrate/20140625214618_create_spree_refunds.rb +1 -1
- data/db/migrate/20140702140656_create_spree_return_authorization_inventory_unit.rb +1 -1
- data/db/migrate/20140707125621_rename_return_authorization_inventory_unit_to_return_items.rb +1 -1
- data/db/migrate/20140708132019_create_order_mutex.rb +1 -1
- data/db/migrate/20140709160534_backfill_line_item_pre_tax_amount.rb +1 -1
- data/db/migrate/20140710041921_recreate_spree_return_authorizations.rb +2 -2
- data/db/migrate/20140710181204_add_amount_fields_to_return_items.rb +1 -1
- data/db/migrate/20140710190048_drop_return_authorization_amount.rb +1 -1
- data/db/migrate/20140713140455_create_spree_return_authorization_reasons.rb +1 -1
- data/db/migrate/20140713140527_create_spree_refund_reasons.rb +1 -1
- data/db/migrate/20140713142214_rename_return_authorization_reason.rb +1 -1
- data/db/migrate/20140715182625_create_spree_promotion_categories.rb +1 -1
- data/db/migrate/20140716204111_drop_received_at_on_return_items.rb +1 -1
- data/db/migrate/20140716212330_add_reception_and_acceptance_status_to_return_items.rb +1 -1
- data/db/migrate/20140717155155_create_default_refund_reason.rb +1 -1
- data/db/migrate/20140717185932_add_default_to_spree_stock_locations.rb +1 -1
- data/db/migrate/20140718133010_create_spree_customer_returns.rb +1 -1
- data/db/migrate/20140718133349_add_customer_return_id_to_return_item.rb +1 -1
- data/db/migrate/20140718195325_create_friendly_id_slugs.rb +1 -1
- data/db/migrate/20140723004419_rename_spree_refund_return_authorization_id.rb +1 -1
- data/db/migrate/20140723152808_increase_return_item_pre_tax_amount_precision.rb +1 -1
- data/db/migrate/20140723214541_copy_product_slugs_to_slug_history.rb +1 -1
- data/db/migrate/20140725131539_create_spree_reimbursements.rb +1 -1
- data/db/migrate/20140728225422_add_promotionable_to_spree_products.rb +1 -1
- data/db/migrate/20140729133613_add_exchange_inventory_unit_foreign_keys.rb +1 -1
- data/db/migrate/20140730155938_add_acceptance_status_errors_to_return_item.rb +1 -1
- data/db/migrate/20140731150017_create_spree_reimbursement_types.rb +1 -1
- data/db/migrate/20140804185157_add_default_to_shipment_cost.rb +1 -1
- data/db/migrate/20140805171035_add_default_to_spree_credit_cards.rb +1 -1
- data/db/migrate/20140805171219_make_existing_credit_cards_default.rb +1 -1
- data/db/migrate/20140806144901_add_type_to_reimbursement_type.rb +1 -1
- data/db/migrate/20140808184039_create_spree_reimbursement_credits.rb +1 -1
- data/db/migrate/20140827170513_add_meta_title_to_spree_products.rb +1 -1
- data/db/migrate/20140924164824_add_code_to_spree_tax_categories.rb +1 -1
- data/db/migrate/20140927193717_default_pre_tax_amount_should_be_zero.rb +1 -1
- data/db/migrate/20141002191113_add_code_to_spree_shipping_methods.rb +1 -1
- data/db/migrate/20141007230328_add_cancel_audit_fields_to_spree_orders.rb +1 -1
- data/db/migrate/20141009204607_add_store_id_to_orders.rb +1 -1
- data/db/migrate/20141012083513_create_spree_taxons_prototypes.rb +1 -1
- data/db/migrate/20141023005240_add_counter_cache_from_spree_variants_to_spree_stock_items.rb +1 -1
- data/db/migrate/20141101231208_fix_adjustment_order_presence.rb +1 -1
- data/db/migrate/20141105213646_update_classifications_positions.rb +1 -1
- data/db/migrate/20141120135441_add_guest_token_index_to_spree_orders.rb +1 -1
- data/db/migrate/20141215235502_remove_extra_products_slug_index.rb +1 -1
- data/db/migrate/20141217215630_update_product_slug_index.rb +1 -1
- data/db/migrate/20141231151320_add_default_column_to_price.rb +1 -1
- data/db/migrate/20150112194216_add_position_to_stock_location.rb +1 -1
- data/db/migrate/20150113002122_create_spree_promotion_codes.rb +1 -1
- data/db/migrate/20150113002123_create_adjustment_promotion_code_association.rb +1 -1
- data/db/migrate/20150121022521_remove_environment_from_payment_method.rb +1 -1
- data/db/migrate/20150121202544_add_restock_inventory_to_stock_location.rb +1 -1
- data/db/migrate/20150122202432_add_code_to_spree_promotion_categories.rb +1 -1
- data/db/migrate/20150127161843_create_order_stock_locations.rb +1 -1
- data/db/migrate/20150128032538_remove_environment_from_tracker.rb +1 -1
- data/db/migrate/20150203151219_add_fulfillable_to_stock_location.rb +1 -1
- data/db/migrate/20150205210527_add_code_to_refund_reason.rb +1 -1
- data/db/migrate/20150213160148_add_promotion_code_id_to_orders_promotions.rb +1 -1
- data/db/migrate/20150213163612_add_approver_name_to_spree_orders.rb +1 -1
- data/db/migrate/20150225205344_move_promotion_code_to_promotion_code_value.rb +1 -1
- data/db/migrate/20150226195213_downcase_promotion_codes_values.rb +1 -1
- data/db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb +1 -1
- data/db/migrate/20150303212749_add_per_code_usage_limit_to_promotions.rb +1 -1
- data/db/migrate/20150303212826_remove_usage_limit_from_promotion_codes.rb +1 -1
- data/db/migrate/20150304211616_add_timestamps_to_order_promotions.rb +1 -1
- data/db/migrate/20150305043021_create_spree_cartons.rb +1 -1
- data/db/migrate/20150305210403_add_timestamps_to_spree_roles_users.rb +1 -1
- data/db/migrate/20150313140507_remove_considered_risky_from_spree_orders.rb +1 -1
- data/db/migrate/20150313192827_add_index_to_inventory_units_carton_id.rb +1 -1
- data/db/migrate/20150313201235_add_imported_from_shipment_id_to_cartons.rb +1 -1
- data/db/migrate/20150313201503_copy_shipped_shipments_to_cartons.rb +1 -1
- data/db/migrate/20150330144639_create_spree_user_stock_locations.rb +1 -1
- data/db/migrate/20150331134544_add_stock_location_code.rb +1 -1
- data/db/migrate/20150402210430_create_unit_cancels.rb +1 -1
- data/db/migrate/20150407173305_add_fields_to_stock_transfer.rb +1 -1
- data/db/migrate/20150407173531_create_transfer_items.rb +1 -1
- data/db/migrate/20150424143547_drop_stock_transfer_type.rb +1 -1
- data/db/migrate/20150424161102_add_stock_transfer_finalized_at.rb +1 -1
- data/db/migrate/20150429125822_rename_stock_transfer_reference.rb +1 -1
- data/db/migrate/20150430233803_create_line_item_actions.rb +1 -1
- data/db/migrate/20150506181159_create_spree_store_credit_categories.rb +1 -1
- data/db/migrate/20150506181244_create_spree_store_credits.rb +1 -1
- data/db/migrate/20150506181539_create_spree_store_credit_events.rb +1 -1
- data/db/migrate/20150506181611_create_spree_store_credit_payment_method.rb +1 -1
- data/db/migrate/20150506181715_create_store_credit_types.rb +1 -1
- data/db/migrate/20150506182045_create_store_credit_reimbursement_type.rb +1 -1
- data/db/migrate/20150508044622_add_resellable_to_return_items.rb +1 -1
- data/db/migrate/20150514185559_add_invalidated_at_to_spree_store_credits.rb +1 -1
- data/db/migrate/20150514201836_migrate_deleted_store_credits_to_invalidated.rb +1 -1
- data/db/migrate/20150515170322_add_check_stock_on_transfer.rb +1 -1
- data/db/migrate/20150515211137_fix_adjustment_order_id.rb +1 -1
- data/db/migrate/20150528125647_delete_inventory_units_without_shipment.rb +1 -1
- data/db/migrate/20150601191251_add_deleted_at_to_stock_transfers.rb +1 -1
- data/db/migrate/20150601204148_add_deleted_at_to_transfer_items.rb +1 -1
- data/db/migrate/20150609093816_increase_scale_on_pre_tax_amounts.rb +1 -1
- data/db/migrate/20150609193231_add_preferences_to_promotion_actions.rb +1 -1
- data/db/migrate/20150610182638_add_id_to_spree_option_values_variants.rb +1 -1
- data/db/migrate/20150611200247_add_frontend_viewable_to_spree_orders.rb +1 -1
- data/db/migrate/20150612205731_remove_spree_configurations.rb +1 -1
- data/db/migrate/20150616204659_add_preference_source_to_spree_payment_methods.rb +1 -1
- data/db/migrate/20150618191713_remove_credit_card_address_id.rb +1 -1
- data/db/migrate/20150618212517_create_spree_store_credit_update_reasons.rb +1 -1
- data/db/migrate/20150619160613_create_adjustment_reason.rb +1 -1
- data/db/migrate/20150622144655_add_update_reason_to_store_credit_events.rb +1 -1
- data/db/migrate/20150623194316_add_return_authorization_reason_id_to_return_items.rb +1 -1
- data/db/migrate/20150623214058_seed_store_credit_update_reasons.rb +1 -1
- data/db/migrate/20150626200816_remove_shipping_method_id_from_spree_orders.rb +1 -1
- data/db/migrate/20150626214817_remove_counter_cache_from_spree_variants_to_spree_stock_items.rb +1 -1
- data/db/migrate/20150629175931_add_address_id_to_credit_card.rb +1 -1
- data/db/migrate/20150630175644_copy_order_bill_address_to_credit_card.rb +1 -1
- data/db/migrate/20150723224133_remove_unnecessary_indexes.rb +1 -1
- data/db/migrate/20150724163716_remove_state_lock_version_from_order.rb +1 -1
- data/db/migrate/20150731201146_add_spree_user_addresses.rb +1 -1
- data/db/migrate/20150806190833_add_id_and_timestamp_to_promotion_rule_user.rb +1 -1
- data/db/migrate/20150811210350_remove_mandatory_from_adjustments.rb +1 -1
- data/db/migrate/20150811211025_add_finalized_to_spree_adjustments.rb +1 -1
- data/db/migrate/20150820160821_add_store_payment_methods.rb +1 -1
- data/db/migrate/20150824213633_convert_habtm_to_hmt_for_shipping_methods_zones.rb +1 -1
- data/db/migrate/20150824214129_convert_habtm_to_hmt_for_products_promotion_rules.rb +1 -1
- data/db/migrate/20150825204216_drop_spree_gateways.rb +1 -1
- data/db/migrate/20150826002555_convert_habtm_to_hmt_for_taxon_prototypes.rb +1 -1
- data/db/migrate/20150909123605_create_variant_properties_and_rules.rb +1 -1
- data/db/migrate/20151001121454_create_spree_shipping_method_stock_locations.rb +1 -1
- data/db/migrate/20151002023248_add_foreign_key_to_shipping_method_stock_location.rb +1 -1
- data/db/migrate/20151010003252_add_foreign_keys_for_taxons_prototypes.rb +1 -1
- data/db/migrate/20151013222921_remove_token_permissions_table.rb +1 -1
- data/db/migrate/20151014213349_rename_identifier_to_number_for_payment.rb +1 -1
- data/db/migrate/20151015203732_add_foreign_keys_for_product_promotion_rules.rb +1 -1
- data/db/migrate/20151021113730_add_sale_to_spree_promotions.rb +1 -1
- data/db/migrate/20151021163309_convert_sale_promotions.rb +1 -1
- data/db/migrate/20151026093607_change_return_item_pre_tax_amount_to_amount.rb +1 -1
- data/db/migrate/20151117063249_convert_habtm_to_hmt_for_properties_prototypes.rb +1 -1
- data/db/migrate/20151124062500_convert_habtm_to_hmt_for_option_type_prototypes.rb +1 -1
- data/db/migrate/20151126063028_convert_habtm_to_hmt_for_taxons_promotion_rules.rb +1 -1
- data/db/migrate/20151219020209_add_stock_item_unique_index.rb +1 -1
- data/db/migrate/20160111091912_add_column_available_to_all_on_spree_shipping_method.rb +1 -1
- data/db/migrate/20160116133604_add_position_to_spree_payment_methods.rb +1 -1
- data/db/migrate/20160122182105_add_carrier_and_service_level_to_spree_shipping_methods.rb +1 -1
- data/db/migrate/20160224201413_create_spree_shipping_rate_taxes.rb +1 -1
- data/db/migrate/20160229133259_add_cart_tax_country_iso_to_spree_store.rb +1 -1
- data/db/migrate/20160301103333_remove_pre_tax_amount_on_line_item_and_shipment.rb +1 -1
- data/db/migrate/20160308000300_disallow_adjustment_finalized_nulls.rb +1 -1
- data/db/migrate/20160318145302_add_timestamps_to_prices.rb +1 -1
- data/db/migrate/20160330204846_add_missing_timestamp_columns.rb +1 -1
- data/db/migrate/20160509181311_add_country_iso_to_prices.rb +1 -1
- data/db/migrate/20160527070401_rename_shipment_address_field.rb +1 -1
- data/db/migrate/20160608162651_ensure_default_store.rb +1 -1
- data/db/migrate/20160608180751_ensure_store_on_orders.rb +1 -1
- data/db/migrate/20160616232103_remove_user_id_from_promotion_rules.rb +1 -1
- data/db/migrate/20160718205341_add_payment_id_index_to_spree_refunds.rb +1 -1
- data/db/migrate/20160718205859_add_reimbursement_id_index_to_spree_refunds.rb +1 -1
- data/lib/generators/spree/custom_user/templates/migration.rb.tt +1 -1
- data/lib/generators/spree/dummy/dummy_generator.rb +4 -1
- data/lib/generators/spree/dummy/templates/rails/test.rb +2 -2
- data/lib/spree/core/importer/order.rb +1 -0
- data/lib/spree/core/importer/product.rb +2 -2
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/deprecation.rb +1 -1
- data/lib/spree/testing_support/common_rake.rb +1 -1
- data/lib/spree/testing_support/factories/adjustment_factory.rb +14 -19
- data/solidus_core.gemspec +4 -4
- data/spec/lib/spree/core/controller_helpers/auth_spec.rb +2 -2
- data/spec/lib/tasks/order_capturing_spec.rb +1 -1
- data/spec/models/spree/adjustment_spec.rb +1 -2
- data/spec/models/spree/credit_card_spec.rb +12 -12
- data/spec/models/spree/item_adjustments_spec.rb +4 -6
- data/spec/models/spree/order/checkout_spec.rb +14 -1
- data/spec/models/spree/order/payment_spec.rb +18 -22
- data/spec/models/spree/order_cancellations_spec.rb +2 -2
- data/spec/models/spree/order_capturing_spec.rb +2 -2
- data/spec/models/spree/order_shipping_spec.rb +2 -2
- data/spec/models/spree/order_spec.rb +8 -56
- data/spec/models/spree/order_update_attributes_spec.rb +1 -5
- data/spec/models/spree/payment_spec.rb +1 -2
- data/spec/models/spree/preferences/preferable_spec.rb +4 -4
- data/spec/models/spree/product_spec.rb +11 -20
- data/spec/models/spree/stock_item_spec.rb +19 -32
- data/spec/models/spree/store_credit_spec.rb +2 -2
- data/spec/models/spree/tax/item_adjuster_spec.rb +2 -1
- data/spec/models/spree/tax/order_adjuster_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- metadata +13 -19
@@ -1,4 +1,4 @@
|
|
1
|
-
class ConvertHabtmToHmtForPropertiesPrototypes < ActiveRecord::Migration
|
1
|
+
class ConvertHabtmToHmtForPropertiesPrototypes < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
3
|
add_column :spree_properties_prototypes, :id, :primary_key
|
4
4
|
add_column :spree_properties_prototypes, :created_at, :datetime
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class ConvertHabtmToHmtForOptionTypePrototypes < ActiveRecord::Migration
|
1
|
+
class ConvertHabtmToHmtForOptionTypePrototypes < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
3
|
add_column :spree_option_types_prototypes, :id, :primary_key
|
4
4
|
add_column :spree_option_types_prototypes, :created_at, :datetime
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class ConvertHabtmToHmtForTaxonsPromotionRules < ActiveRecord::Migration
|
1
|
+
class ConvertHabtmToHmtForTaxonsPromotionRules < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
3
|
add_column :spree_taxons_promotion_rules, :created_at, :datetime
|
4
4
|
add_column :spree_taxons_promotion_rules, :updated_at, :datetime
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AddCarrierAndServiceLevelToSpreeShippingMethods < ActiveRecord::Migration
|
1
|
+
class AddCarrierAndServiceLevelToSpreeShippingMethods < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
add_column :spree_shipping_methods, :carrier, :string
|
4
4
|
add_column :spree_shipping_methods, :service_level, :string
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class RemovePreTaxAmountOnLineItemAndShipment < ActiveRecord::Migration
|
1
|
+
class RemovePreTaxAmountOnLineItemAndShipment < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
remove_column :spree_line_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false
|
4
4
|
remove_column :spree_shipments, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class AddSpreeFieldsToCustomUserTable < ActiveRecord::Migration
|
1
|
+
class AddSpreeFieldsToCustomUserTable < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
3
|
add_column <%= table_name.inspect %>, :spree_api_key, :string, :limit => 48
|
4
4
|
add_column <%= table_name.inspect %>, :ship_address_id, :integer
|
@@ -48,6 +48,9 @@ module Spree
|
|
48
48
|
template "rails/test.rb", "#{dummy_path}/config/environments/test.rb", force: true
|
49
49
|
template "rails/script/rails", "#{dummy_path}/spec/dummy/script/rails", force: true
|
50
50
|
template "initializers/custom_user.rb", "#{dummy_path}/config/initializers/custom_user.rb", force: true
|
51
|
+
|
52
|
+
# FIXME: We aren't ready for rails 5 defaults
|
53
|
+
remove_file "#{dummy_path}/config/initializers/new_framework_defaults.rb"
|
51
54
|
end
|
52
55
|
|
53
56
|
def test_dummy_inject_extension_requirements
|
@@ -124,7 +127,7 @@ end
|
|
124
127
|
core_gems = ["spree/core", "spree/api", "spree/backend", "spree/frontend"]
|
125
128
|
|
126
129
|
if core_gems.include?(lib_name)
|
127
|
-
'
|
130
|
+
'../../../../../Gemfile'
|
128
131
|
else
|
129
132
|
'../../../../Gemfile'
|
130
133
|
end
|
@@ -8,8 +8,8 @@ Dummy::Application.configure do
|
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
11
|
-
config.
|
12
|
-
config.
|
11
|
+
config.public_file_server.enabled = true
|
12
|
+
config.public_file_server.headers = { 'Cache-Control' => "public, max-age=3600" }
|
13
13
|
|
14
14
|
# Show full error reports and disable caching
|
15
15
|
config.consider_all_requests_local = true
|
@@ -7,8 +7,8 @@ module Spree
|
|
7
7
|
def initialize(product, product_params, options = {})
|
8
8
|
@product = product || Spree::Product.new(product_params)
|
9
9
|
|
10
|
-
@product_attrs = product_params
|
11
|
-
@variants_attrs = options[:variants_attrs] || []
|
10
|
+
@product_attrs = product_params.to_h
|
11
|
+
@variants_attrs = (options[:variants_attrs] || []).map(&:to_h)
|
12
12
|
@options_attrs = options[:options_attrs] || []
|
13
13
|
end
|
14
14
|
|
data/lib/spree/core/version.rb
CHANGED
data/lib/spree/deprecation.rb
CHANGED
@@ -17,7 +17,7 @@ namespace :common do
|
|
17
17
|
|
18
18
|
puts "Setting up dummy database..."
|
19
19
|
|
20
|
-
sh "bundle exec rake db:
|
20
|
+
sh "bundle exec rake db:migrate VERBOSE=false"
|
21
21
|
|
22
22
|
begin
|
23
23
|
require "generators/#{ENV['LIB_NAME']}/install/install_generator"
|
@@ -12,27 +12,22 @@ FactoryGirl.define do
|
|
12
12
|
label 'Shipping'
|
13
13
|
association(:source, factory: :tax_rate)
|
14
14
|
eligible true
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
factory :tax_adjustment, class: Spree::Adjustment do
|
24
|
-
order { adjustable.order }
|
25
|
-
association(:adjustable, factory: :line_item)
|
26
|
-
amount 10.0
|
27
|
-
label 'VAT 5%'
|
17
|
+
factory :tax_adjustment, class: Spree::Adjustment do
|
18
|
+
order { adjustable.order }
|
19
|
+
association(:adjustable, factory: :line_item)
|
20
|
+
amount 10.0
|
21
|
+
label 'VAT 5%'
|
22
|
+
association(:source, factory: :tax_rate)
|
23
|
+
eligible true
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
25
|
+
after(:create) do |adjustment|
|
26
|
+
# Set correct tax category, so that adjustment amount is not 0
|
27
|
+
if adjustment.adjustable.is_a?(Spree::LineItem)
|
28
|
+
adjustment.source.tax_category = adjustment.adjustable.tax_category
|
29
|
+
adjustment.source.save
|
30
|
+
adjustment.update!
|
36
31
|
end
|
37
32
|
end
|
38
33
|
end
|
data/solidus_core.gemspec
CHANGED
@@ -30,12 +30,12 @@ Gem::Specification.new do |s|
|
|
30
30
|
s.add_dependency 'kaminari', '~> 0.15', '>= 0.15.1'
|
31
31
|
s.add_dependency 'monetize', '~> 1.1'
|
32
32
|
s.add_dependency 'paperclip', '~> 4.2'
|
33
|
-
s.add_dependency 'paranoia', '~> 2.
|
33
|
+
s.add_dependency 'paranoia', '~> 2.2.0.pre'
|
34
34
|
s.add_dependency 'premailer-rails'
|
35
|
-
s.add_dependency 'rails', '~>
|
36
|
-
s.add_dependency 'ransack', '~> 1.
|
35
|
+
s.add_dependency 'rails', '~> 5.0.0'
|
36
|
+
s.add_dependency 'ransack', '~> 1.8'
|
37
37
|
s.add_dependency 'responders'
|
38
|
-
s.add_dependency 'state_machines-activerecord', '~> 0.
|
38
|
+
s.add_dependency 'state_machines-activerecord', '~> 0.4'
|
39
39
|
s.add_dependency 'stringex', '~> 1.5.1'
|
40
40
|
s.add_dependency 'truncate_html', '~> 0.9', '>= 0.9.2'
|
41
41
|
s.add_dependency 'twitter_cldr', '~> 3.0'
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
class FakesController < ApplicationController
|
4
4
|
include Spree::Core::ControllerHelpers::Auth
|
5
|
-
def index; render
|
5
|
+
def index; render plain: 'index'; end
|
6
6
|
end
|
7
7
|
|
8
8
|
describe Spree::Core::ControllerHelpers::Auth, type: :controller do
|
@@ -33,7 +33,7 @@ describe Spree::Core::ControllerHelpers::Auth, type: :controller do
|
|
33
33
|
controller(FakesController) do
|
34
34
|
def index
|
35
35
|
set_guest_token
|
36
|
-
render
|
36
|
+
render plain: 'index'
|
37
37
|
end
|
38
38
|
end
|
39
39
|
it 'sends cookie header' do
|
@@ -18,7 +18,7 @@ describe "order_capturing:capture_payments" do
|
|
18
18
|
|
19
19
|
context "with a mix of canceled and shipped inventory" do
|
20
20
|
before do
|
21
|
-
Spree::OrderCancellations.new(order).short_ship([order.
|
21
|
+
Spree::OrderCancellations.new(order).short_ship([order.inventory_units.first])
|
22
22
|
order.shipping.ship_shipment(order.shipments.first)
|
23
23
|
order.update_attributes!(payment_state: 'balance_due')
|
24
24
|
end
|
@@ -14,8 +14,7 @@ describe Spree::Adjustment, type: :model do
|
|
14
14
|
let(:adjustment) { Spree::Adjustment.create(label: "Adjustment", amount: 5, order: order, adjustable: line_item) }
|
15
15
|
|
16
16
|
it 'touches the adjustable' do
|
17
|
-
line_item.
|
18
|
-
expect { adjustment.save! }.to change { line_item.updated_at }
|
17
|
+
expect { adjustment.save }.to change { line_item.updated_at }
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|
@@ -35,7 +35,7 @@ describe Spree::CreditCard, type: :model do
|
|
35
35
|
allow(@payment).to receive_messages payment_method: @payment_gateway
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
context "#can_capture?" do
|
39
39
|
it "should be true if payment is pending" do
|
40
40
|
payment = mock_model(Spree::Payment, pending?: true, created_at: Time.current)
|
41
41
|
expect(credit_card.can_capture?(payment)).to be true
|
@@ -47,14 +47,14 @@ describe Spree::CreditCard, type: :model do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
|
50
|
+
context "#can_void?" do
|
51
51
|
it "should be true if payment is not void" do
|
52
52
|
payment = mock_model(Spree::Payment, failed?: false, void?: false)
|
53
53
|
expect(credit_card.can_void?(payment)).to be true
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
|
57
|
+
context "#can_credit?" do
|
58
58
|
it "should be false if payment is not completed" do
|
59
59
|
payment = mock_model(Spree::Payment, completed?: false)
|
60
60
|
expect(credit_card.can_credit?(payment)).to be false
|
@@ -66,7 +66,7 @@ describe Spree::CreditCard, type: :model do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
|
69
|
+
context "#valid?" do
|
70
70
|
it "should validate presence of number" do
|
71
71
|
credit_card.attributes = valid_credit_card_attributes.except(:number)
|
72
72
|
expect(credit_card).not_to be_valid
|
@@ -109,7 +109,7 @@ describe Spree::CreditCard, type: :model do
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
-
|
112
|
+
context "#save" do
|
113
113
|
before do
|
114
114
|
credit_card.attributes = valid_credit_card_attributes
|
115
115
|
credit_card.save!
|
@@ -145,7 +145,7 @@ describe Spree::CreditCard, type: :model do
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
-
|
148
|
+
context "#number=" do
|
149
149
|
it "should strip non-numeric characters from card input" do
|
150
150
|
credit_card.number = "6011000990139424"
|
151
151
|
expect(credit_card.number).to eq("6011000990139424")
|
@@ -161,7 +161,7 @@ describe Spree::CreditCard, type: :model do
|
|
161
161
|
end
|
162
162
|
|
163
163
|
# Regression test for https://github.com/spree/spree/issues/3847 and https://github.com/spree/spree/issues/3896
|
164
|
-
|
164
|
+
context "#expiry=" do
|
165
165
|
it "can set with a 2-digit month and year" do
|
166
166
|
credit_card.expiry = '04 / 15'
|
167
167
|
expect(credit_card.month).to eq('4')
|
@@ -208,7 +208,7 @@ describe Spree::CreditCard, type: :model do
|
|
208
208
|
end
|
209
209
|
end
|
210
210
|
|
211
|
-
|
211
|
+
context "#cc_type=" do
|
212
212
|
it "converts between the different types" do
|
213
213
|
credit_card.cc_type = 'mastercard'
|
214
214
|
expect(credit_card.cc_type).to eq('master')
|
@@ -257,13 +257,13 @@ describe Spree::CreditCard, type: :model do
|
|
257
257
|
end
|
258
258
|
end
|
259
259
|
|
260
|
-
|
260
|
+
context "#associations" do
|
261
261
|
it "should be able to access its payments" do
|
262
262
|
credit_card.payments.to_a
|
263
263
|
end
|
264
264
|
end
|
265
265
|
|
266
|
-
|
266
|
+
context "#first_name" do
|
267
267
|
before do
|
268
268
|
credit_card.name = "Ludwig van Beethoven"
|
269
269
|
end
|
@@ -273,7 +273,7 @@ describe Spree::CreditCard, type: :model do
|
|
273
273
|
end
|
274
274
|
end
|
275
275
|
|
276
|
-
|
276
|
+
context "#last_name" do
|
277
277
|
before do
|
278
278
|
credit_card.name = "Ludwig van Beethoven"
|
279
279
|
end
|
@@ -283,7 +283,7 @@ describe Spree::CreditCard, type: :model do
|
|
283
283
|
end
|
284
284
|
end
|
285
285
|
|
286
|
-
|
286
|
+
context "#to_active_merchant" do
|
287
287
|
before do
|
288
288
|
credit_card.number = "4111111111111111"
|
289
289
|
credit_card.year = Time.current.year
|
@@ -272,9 +272,6 @@ module Spree
|
|
272
272
|
context "multiple updates" do
|
273
273
|
let(:adjustment) { create(:tax_adjustment, amount: -10) }
|
274
274
|
let(:item) { adjustment.adjustable }
|
275
|
-
# we need to get this from the line item so that we're modifying the same
|
276
|
-
# tax rate that is cached by line_item.adjustments
|
277
|
-
let(:source) { item.adjustments.to_a.first.source }
|
278
275
|
|
279
276
|
def update
|
280
277
|
described_class.new(item).update
|
@@ -286,17 +283,18 @@ module Spree
|
|
286
283
|
end
|
287
284
|
|
288
285
|
it "persists each change" do
|
289
|
-
source.update_attributes!(amount: 0.1)
|
286
|
+
adjustment.source.update_attributes!(amount: 0.1)
|
290
287
|
update
|
291
288
|
expect(item).not_to be_changed
|
292
289
|
expect(db_record).to have_attributes(adjustment_total: 1)
|
293
290
|
|
294
|
-
source.update_attributes!(amount: 0.20)
|
291
|
+
adjustment.source.update_attributes!(amount: 0.20)
|
292
|
+
item.reload
|
295
293
|
update
|
296
294
|
expect(item).not_to be_changed
|
297
295
|
expect(db_record).to have_attributes(adjustment_total: 2)
|
298
296
|
|
299
|
-
source.update_attributes!(amount: 0.10)
|
297
|
+
adjustment.source.update_attributes!(amount: 0.10)
|
300
298
|
update
|
301
299
|
expect(item).not_to be_changed
|
302
300
|
expect(db_record).to have_attributes(adjustment_total: 1)
|
@@ -868,10 +868,23 @@ describe Spree::Order, type: :model do
|
|
868
868
|
end
|
869
869
|
end
|
870
870
|
|
871
|
-
context '
|
871
|
+
context 'callback returns false' do
|
872
872
|
before do
|
873
873
|
expect(order).to receive(:update_params_payment_source).and_return false
|
874
874
|
end
|
875
|
+
it 'does not let through unpermitted attributes' do
|
876
|
+
expect(order).not_to receive(:assign_attributes)
|
877
|
+
expect(order).not_to receive(:save)
|
878
|
+
ActiveSupport::Deprecation.silence do
|
879
|
+
order.update_from_params(params, permitted_params)
|
880
|
+
end
|
881
|
+
end
|
882
|
+
end
|
883
|
+
|
884
|
+
context 'callback throws abort' do
|
885
|
+
before do
|
886
|
+
expect(order).to receive(:update_params_payment_source).and_throw :abort
|
887
|
+
end
|
875
888
|
it 'does not let through unpermitted attributes' do
|
876
889
|
expect(order).not_to receive(:assign_attributes)
|
877
890
|
expect(order).not_to receive(:save)
|
@@ -6,53 +6,49 @@ module Spree
|
|
6
6
|
let(:updater) { Spree::OrderUpdater.new(order) }
|
7
7
|
|
8
8
|
context "processing payments" do
|
9
|
-
let(:order) { create(:order_with_line_items, shipment_cost: 0, line_items_price: 100) }
|
10
9
|
before do
|
11
10
|
# So that Payment#purchase! is called during processing
|
12
11
|
Spree::Config[:auto_capture] = true
|
12
|
+
|
13
|
+
allow(order).to receive_message_chain(:line_items, :empty?).and_return(false)
|
14
|
+
allow(order).to receive_messages total: 100
|
13
15
|
end
|
14
16
|
|
15
17
|
it 'processes all checkout payments' do
|
16
|
-
payment_1 = create(:payment,
|
17
|
-
payment_2 = create(:payment,
|
18
|
+
payment_1 = create(:payment, amount: 50)
|
19
|
+
payment_2 = create(:payment, amount: 50)
|
20
|
+
allow(order).to receive(:unprocessed_payments).and_return([payment_1, payment_2])
|
18
21
|
|
19
22
|
order.process_payments!
|
20
23
|
updater.update_payment_state
|
21
|
-
|
22
24
|
expect(order.payment_state).to eq('paid')
|
23
|
-
expect(order.payment_total).to eq(100)
|
24
25
|
|
25
|
-
expect(payment_1
|
26
|
-
expect(payment_2
|
26
|
+
expect(payment_1).to be_completed
|
27
|
+
expect(payment_2).to be_completed
|
27
28
|
end
|
28
29
|
|
29
30
|
it 'does not go over total for order' do
|
30
|
-
payment_1 = create(:payment,
|
31
|
-
payment_2 = create(:payment,
|
32
|
-
payment_3 = create(:payment,
|
31
|
+
payment_1 = create(:payment, amount: 50)
|
32
|
+
payment_2 = create(:payment, amount: 50)
|
33
|
+
payment_3 = create(:payment, amount: 50)
|
34
|
+
allow(order).to receive(:unprocessed_payments).and_return([payment_1, payment_2, payment_3])
|
33
35
|
|
34
36
|
order.process_payments!
|
35
37
|
updater.update_payment_state
|
36
|
-
|
37
38
|
expect(order.payment_state).to eq('paid')
|
38
|
-
expect(order.payment_total).to eq(100)
|
39
39
|
|
40
|
-
expect(payment_1
|
41
|
-
expect(payment_2
|
42
|
-
expect(payment_3
|
40
|
+
expect(payment_1).to be_completed
|
41
|
+
expect(payment_2).to be_completed
|
42
|
+
expect(payment_3).to be_checkout
|
43
43
|
end
|
44
44
|
|
45
45
|
it "does not use failed payments" do
|
46
|
-
create(:payment,
|
47
|
-
create(:payment,
|
48
|
-
order.payments.reload
|
46
|
+
payment_1 = create(:payment, amount: 50)
|
47
|
+
payment_2 = create(:payment, amount: 50, state: 'failed')
|
49
48
|
|
50
|
-
expect(
|
51
|
-
expect(order.payments[1]).not_to receive(:process!)
|
49
|
+
expect(payment_2).not_to receive(:process!)
|
52
50
|
|
53
51
|
order.process_payments!
|
54
|
-
|
55
|
-
expect(order.payment_total).to eq(50)
|
56
52
|
end
|
57
53
|
end
|
58
54
|
|
@@ -139,9 +139,9 @@ describe Spree::OrderCancellations do
|
|
139
139
|
order.contents.add(line_item.variant)
|
140
140
|
|
141
141
|
# make the total $1.67 so it divides unevenly
|
142
|
-
|
143
|
-
source_type: 'Spree::TaxRate',
|
142
|
+
Spree::Adjustment.tax.create!(
|
144
143
|
order: order,
|
144
|
+
adjustable: line_item,
|
145
145
|
amount: 0.01,
|
146
146
|
label: 'some fake tax',
|
147
147
|
finalized: true
|
@@ -4,8 +4,8 @@ describe Spree::OrderCapturing do
|
|
4
4
|
describe '#capture_payments' do
|
5
5
|
subject { Spree::OrderCapturing.new(order, payment_methods).capture_payments }
|
6
6
|
|
7
|
-
# Regression for
|
8
|
-
# See
|
7
|
+
# Regression for the order.update! in the ensure block.
|
8
|
+
# See the comment there.
|
9
9
|
context "updating the order" do
|
10
10
|
let(:order) { create :completed_order_with_totals }
|
11
11
|
let(:payment_methods) { [] }
|
@@ -30,7 +30,7 @@ describe Spree::OrderShipping do
|
|
30
30
|
|
31
31
|
it "updates shipment.shipped_at" do
|
32
32
|
Timecop.freeze do |now|
|
33
|
-
expect { subject }.to change { shipment.shipped_at }.from(nil).to
|
33
|
+
expect { subject }.to change { shipment.shipped_at }.from(nil).to(now)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -40,7 +40,7 @@ describe Spree::OrderShipping do
|
|
40
40
|
Timecop.freeze(future) do
|
41
41
|
subject
|
42
42
|
end
|
43
|
-
end.to change { order.updated_at }.
|
43
|
+
end.to change { order.updated_at }.from(order.updated_at).to(future)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|