solidus_starter_frontend 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +30 -514
- data/.circleci/config.yml +0 -57
- data/.erb-lint.yml +0 -22
- data/.eslintrc +0 -5
- data/.gem_release.yml +0 -5
- data/.github/pull_request_template.md +0 -28
- data/.github/stale.yml +0 -17
- data/.gitignore +0 -17
- data/.hound.yml +0 -16
- data/.rspec +0 -2
- data/.rubocop.yml +0 -19
- data/.rubocop_todo.yml +0 -229
- data/.scss-lint.yml +0 -4
- data/Gemfile +0 -34
- data/LICENSE +0 -26
- data/README.md +0 -69
- data/Rakefile +0 -6
- data/app/assets/config/solidus_starter_frontend_manifest.js +0 -2
- data/app/assets/javascripts/spree/frontend/cart.js +0 -26
- data/app/assets/javascripts/spree/frontend/checkout/address.js +0 -124
- data/app/assets/javascripts/spree/frontend/checkout/payment.js +0 -44
- data/app/assets/javascripts/spree/frontend/checkout.js +0 -34
- data/app/assets/javascripts/spree/frontend/locale_selector.js +0 -9
- data/app/assets/javascripts/spree/frontend/product.js +0 -21
- data/app/assets/javascripts/spree/frontend/solidus_starter_frontend.js +0 -9
- data/app/assets/javascripts/spree/frontend/utils.js.erb +0 -18
- data/app/assets/javascripts/spree/frontend.js +0 -6
- data/app/assets/stylesheets/spree/frontend/base/_base.scss +0 -29
- data/app/assets/stylesheets/spree/frontend/base/_reset.scss +0 -179
- data/app/assets/stylesheets/spree/frontend/base/_responsive.scss +0 -21
- data/app/assets/stylesheets/spree/frontend/components/account/_account_order.scss +0 -23
- data/app/assets/stylesheets/spree/frontend/components/account/_account_summary.scss +0 -17
- data/app/assets/stylesheets/spree/frontend/components/auth/_auth_container.scss +0 -11
- data/app/assets/stylesheets/spree/frontend/components/auth/_auth_form.scss +0 -5
- data/app/assets/stylesheets/spree/frontend/components/brand/_logo.scss +0 -4
- data/app/assets/stylesheets/spree/frontend/components/buttons/_button_inline.scss +0 -8
- data/app/assets/stylesheets/spree/frontend/components/buttons/_button_primary.scss +0 -26
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_adjustments.scss +0 -6
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_amount_row.scss +0 -11
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_empty.scss +0 -10
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_footer.scss +0 -20
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_header.scss +0 -12
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_item.scss +0 -86
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_link.scss +0 -22
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_page.scss +0 -15
- data/app/assets/stylesheets/spree/frontend/components/cart/_cart_secondary_actions.scss +0 -19
- data/app/assets/stylesheets/spree/frontend/components/cart/_coupon_code.scss +0 -8
- data/app/assets/stylesheets/spree/frontend/components/cart/_item_info.scss +0 -19
- data/app/assets/stylesheets/spree/frontend/components/checkout/_checkout.scss +0 -27
- data/app/assets/stylesheets/spree/frontend/components/checkout/_checkout_header.scss +0 -19
- data/app/assets/stylesheets/spree/frontend/components/checkout/_checkout_summary.scss +0 -31
- data/app/assets/stylesheets/spree/frontend/components/checkout/_existing_cards.scss +0 -27
- data/app/assets/stylesheets/spree/frontend/components/checkout/_payment_method_controls.scss +0 -5
- data/app/assets/stylesheets/spree/frontend/components/checkout/_payment_method_selector.scss +0 -14
- data/app/assets/stylesheets/spree/frontend/components/checkout/_progress_steps.scss +0 -38
- data/app/assets/stylesheets/spree/frontend/components/checkout/_proposed_shipment.scss +0 -18
- data/app/assets/stylesheets/spree/frontend/components/checkout/_shipment_items.scss +0 -50
- data/app/assets/stylesheets/spree/frontend/components/checkout/_shipping_methods.scss +0 -9
- data/app/assets/stylesheets/spree/frontend/components/checkout/payments/_gateway_payment_method.scss +0 -11
- data/app/assets/stylesheets/spree/frontend/components/checkout/steps/_address_step.scss +0 -20
- data/app/assets/stylesheets/spree/frontend/components/checkout/steps/_confirm_step.scss +0 -13
- data/app/assets/stylesheets/spree/frontend/components/checkout/steps/_delivery_step.scss +0 -13
- data/app/assets/stylesheets/spree/frontend/components/checkout/steps/_payment_step.scss +0 -13
- data/app/assets/stylesheets/spree/frontend/components/forms/_address_inputs.scss +0 -13
- data/app/assets/stylesheets/spree/frontend/components/forms/inputs/_checkbox_input.scss +0 -3
- data/app/assets/stylesheets/spree/frontend/components/forms/inputs/_radio_input.scss +0 -3
- data/app/assets/stylesheets/spree/frontend/components/forms/inputs/_select_input.scss +0 -27
- data/app/assets/stylesheets/spree/frontend/components/forms/inputs/_text.scss +0 -32
- data/app/assets/stylesheets/spree/frontend/components/forms/inputs/_textarea_input.scss +0 -25
- data/app/assets/stylesheets/spree/frontend/components/general/_flash.scss +0 -20
- data/app/assets/stylesheets/spree/frontend/components/layout/_aside.scss +0 -4
- data/app/assets/stylesheets/spree/frontend/components/layout/_breadcrumbs.scss +0 -16
- data/app/assets/stylesheets/spree/frontend/components/layout/_category_navigation.scss +0 -3
- data/app/assets/stylesheets/spree/frontend/components/layout/_footer.scss +0 -8
- data/app/assets/stylesheets/spree/frontend/components/layout/_header.scss +0 -12
- data/app/assets/stylesheets/spree/frontend/components/layout/_horizontal_input_group.scss +0 -7
- data/app/assets/stylesheets/spree/frontend/components/layout/_top_bar.scss +0 -44
- data/app/assets/stylesheets/spree/frontend/components/navigation/_auth_link.scss +0 -11
- data/app/assets/stylesheets/spree/frontend/components/navigation/_categories.scss +0 -29
- data/app/assets/stylesheets/spree/frontend/components/navigation/_locale_selector.scss +0 -21
- data/app/assets/stylesheets/spree/frontend/components/navigation/_taxonomies.scss +0 -7
- data/app/assets/stylesheets/spree/frontend/components/navigation/_taxonomy.scss +0 -28
- data/app/assets/stylesheets/spree/frontend/components/orders/_address_overview.scss +0 -27
- data/app/assets/stylesheets/spree/frontend/components/orders/_coupon_codes.scss +0 -4
- data/app/assets/stylesheets/spree/frontend/components/orders/_line_items.scss +0 -20
- data/app/assets/stylesheets/spree/frontend/components/orders/_order_details.scss +0 -18
- data/app/assets/stylesheets/spree/frontend/components/orders/_order_item.scss +0 -85
- data/app/assets/stylesheets/spree/frontend/components/orders/_order_page.scss +0 -41
- data/app/assets/stylesheets/spree/frontend/components/orders/_order_shipments.scss +0 -27
- data/app/assets/stylesheets/spree/frontend/components/orders/_payment_info.scss +0 -29
- data/app/assets/stylesheets/spree/frontend/components/presentation/_hero.scss +0 -18
- data/app/assets/stylesheets/spree/frontend/components/products/_product_card.scss +0 -35
- data/app/assets/stylesheets/spree/frontend/components/products/_product_image.scss +0 -7
- data/app/assets/stylesheets/spree/frontend/components/products/_product_info.scss +0 -14
- data/app/assets/stylesheets/spree/frontend/components/products/_product_page.scss +0 -31
- data/app/assets/stylesheets/spree/frontend/components/products/_product_properties.scss +0 -23
- data/app/assets/stylesheets/spree/frontend/components/products/_product_submit.scss +0 -9
- data/app/assets/stylesheets/spree/frontend/components/products/_product_taxons.scss +0 -27
- data/app/assets/stylesheets/spree/frontend/components/products/_product_thumbnails.scss +0 -7
- data/app/assets/stylesheets/spree/frontend/components/products/_product_variants.scss +0 -20
- data/app/assets/stylesheets/spree/frontend/components/products/_products.scss +0 -13
- data/app/assets/stylesheets/spree/frontend/components/products/_products_by_taxon.scss +0 -6
- data/app/assets/stylesheets/spree/frontend/components/products/_products_grid.scss +0 -18
- data/app/assets/stylesheets/spree/frontend/components/search/_filter.scss +0 -32
- data/app/assets/stylesheets/spree/frontend/components/search/_search_bar.scss +0 -34
- data/app/assets/stylesheets/spree/frontend/components/typography/_hero_title.scss +0 -6
- data/app/assets/stylesheets/spree/frontend/components/typography/_subtitle.scss +0 -7
- data/app/assets/stylesheets/spree/frontend/placeholders/main.scss +0 -5
- data/app/assets/stylesheets/spree/frontend/screen.scss +0 -89
- data/app/assets/stylesheets/spree/frontend/solidus_starter_frontend.css +0 -7
- data/app/assets/stylesheets/spree/frontend/variables/_colors.scss +0 -20
- data/app/assets/stylesheets/spree/frontend.css +0 -8
- data/app/controllers/concerns/solidus_starter_frontend/auth_views.rb +0 -16
- data/app/controllers/concerns/solidus_starter_frontend/taxonomies.rb +0 -16
- data/app/controllers/spree/checkout_controller.rb +0 -249
- data/app/controllers/spree/coupon_codes_controller.rb +0 -35
- data/app/controllers/spree/home_controller.rb +0 -13
- data/app/controllers/spree/locale_controller.rb +0 -20
- data/app/controllers/spree/orders_controller.rb +0 -126
- data/app/controllers/spree/products_controller.rb +0 -51
- data/app/controllers/spree/store_controller.rb +0 -31
- data/app/controllers/spree/taxons_controller.rb +0 -30
- data/app/helpers/spree/orders_helper.rb +0 -18
- data/app/helpers/spree/taxon_filters_helper.rb +0 -13
- data/app/views/spree/address/_form_hidden.html.erb +0 -12
- data/app/views/spree/checkout/_terms_and_conditions.en.html.erb +0 -1
- data/app/views/spree/checkout/edit.html.erb +0 -16
- data/app/views/spree/checkout/existing_payment/_gateway.html.erb +0 -9
- data/app/views/spree/checkout/payment/_check.html.erb +0 -0
- data/app/views/spree/checkout/payment/_gateway.html.erb +0 -43
- data/app/views/spree/components/auth/_change_form.html.erb +0 -40
- data/app/views/spree/components/auth/_forgot_form.html.erb +0 -28
- data/app/views/spree/components/auth/_guest_form.html.erb +0 -31
- data/app/views/spree/components/auth/_login_form.html.erb +0 -42
- data/app/views/spree/components/auth/_signup_form.html.erb +0 -48
- data/app/views/spree/components/brand/_logo.html.erb +0 -3
- data/app/views/spree/components/buttons/_button_inline.html.erb +0 -23
- data/app/views/spree/components/buttons/_button_primary.html.erb +0 -29
- data/app/views/spree/components/cart/_cart_adjustment.html.erb +0 -15
- data/app/views/spree/components/cart/_cart_adjustments.html.erb +0 -47
- data/app/views/spree/components/cart/_cart_amount_row.html.erb +0 -12
- data/app/views/spree/components/cart/_cart_empty.html.erb +0 -9
- data/app/views/spree/components/cart/_cart_footer.html.erb +0 -15
- data/app/views/spree/components/cart/_cart_header.html.erb +0 -17
- data/app/views/spree/components/cart/_cart_item.html.erb +0 -52
- data/app/views/spree/components/cart/_cart_items.html.erb +0 -23
- data/app/views/spree/components/cart/_cart_link.html.erb +0 -9
- data/app/views/spree/components/cart/_cart_secondary_actions.html.erb +0 -17
- data/app/views/spree/components/cart/_item_info.html.erb +0 -26
- data/app/views/spree/components/checkout/_checkout_header.html.erb +0 -8
- data/app/views/spree/components/checkout/_checkout_step.html.erb +0 -21
- data/app/views/spree/components/checkout/_checkout_summary.html.erb +0 -70
- data/app/views/spree/components/checkout/_existing_cards.html.erb +0 -39
- data/app/views/spree/components/checkout/_payment_method_controls.html.erb +0 -10
- data/app/views/spree/components/checkout/_payment_method_selector.html.erb +0 -14
- data/app/views/spree/components/checkout/_proposed_shipment.erb +0 -18
- data/app/views/spree/components/checkout/_shipment_items.html.erb +0 -22
- data/app/views/spree/components/checkout/_shipping_methods.html.erb +0 -20
- data/app/views/spree/components/checkout/_unshippable_items.html.erb +0 -7
- data/app/views/spree/components/checkout/steps/_address_step.html.erb +0 -60
- data/app/views/spree/components/checkout/steps/_confirm_step.html.erb +0 -31
- data/app/views/spree/components/checkout/steps/_delivery_step.html.erb +0 -31
- data/app/views/spree/components/checkout/steps/_payment_step.html.erb +0 -25
- data/app/views/spree/components/forms/_address_inputs.html.erb +0 -152
- data/app/views/spree/components/forms/inputs/_checkbox_input.html.erb +0 -29
- data/app/views/spree/components/forms/inputs/_collection_select.html.erb +0 -42
- data/app/views/spree/components/forms/inputs/_radio_input.html.erb +0 -29
- data/app/views/spree/components/forms/inputs/_select_input.html.erb +0 -31
- data/app/views/spree/components/forms/inputs/_text.html.erb +0 -54
- data/app/views/spree/components/forms/inputs/_textarea_input.html.erb +0 -42
- data/app/views/spree/components/layout/_category_navigation.html.erb +0 -3
- data/app/views/spree/components/layout/_footer.html.erb +0 -7
- data/app/views/spree/components/layout/_header.html.erb +0 -8
- data/app/views/spree/components/layout/_top_bar.html.erb +0 -8
- data/app/views/spree/components/navigation/_auth_link.html.erb +0 -1
- data/app/views/spree/components/navigation/_breadcrumbs.html.erb +0 -47
- data/app/views/spree/components/navigation/_categories.html.erb +0 -12
- data/app/views/spree/components/navigation/_locale_selector.html.erb +0 -25
- data/app/views/spree/components/navigation/_taxonomies.html.erb +0 -17
- data/app/views/spree/components/navigation/_taxons.html.erb +0 -17
- data/app/views/spree/components/navigation/_taxons_tree.html.erb +0 -29
- data/app/views/spree/components/orders/_address_overview.html.erb +0 -40
- data/app/views/spree/components/orders/_coupon_code.html.erb +0 -22
- data/app/views/spree/components/orders/_line_items.html.erb +0 -55
- data/app/views/spree/components/orders/_order_details.html.erb +0 -35
- data/app/views/spree/components/orders/_order_item.html.erb +0 -33
- data/app/views/spree/components/orders/_order_items.html.erb +0 -5
- data/app/views/spree/components/orders/_order_shipments.html.erb +0 -25
- data/app/views/spree/components/orders/_payment_info.html.erb +0 -31
- data/app/views/spree/components/presentation/_hero.html.erb +0 -14
- data/app/views/spree/components/products/_product-card.html.erb +0 -36
- data/app/views/spree/components/products/_product_availability.html.erb +0 -19
- data/app/views/spree/components/products/_product_form.html.erb +0 -21
- data/app/views/spree/components/products/_product_image.html.erb +0 -6
- data/app/views/spree/components/products/_product_info.html.erb +0 -9
- data/app/views/spree/components/products/_product_promotions.html.erb +0 -25
- data/app/views/spree/components/products/_product_properties.html.erb +0 -19
- data/app/views/spree/components/products/_product_submit.html.erb +0 -39
- data/app/views/spree/components/products/_product_taxons.html.erb +0 -15
- data/app/views/spree/components/products/_product_thumbnails.html.erb +0 -19
- data/app/views/spree/components/products/_product_variants.html.erb +0 -36
- data/app/views/spree/components/products/_products-grid.html.erb +0 -13
- data/app/views/spree/components/products/_products.html.erb +0 -28
- data/app/views/spree/components/products/_products_by_taxon.html.erb +0 -7
- data/app/views/spree/components/products/_variants_list.html.erb +0 -12
- data/app/views/spree/components/search/_filter.html.erb +0 -42
- data/app/views/spree/components/search/_filters.html.erb +0 -20
- data/app/views/spree/components/search/_form.html.erb +0 -12
- data/app/views/spree/components/search/_products_search.html.erb +0 -36
- data/app/views/spree/components/search/_search_bar.html.erb +0 -36
- data/app/views/spree/components/typography/_hero_title.html.erb +0 -11
- data/app/views/spree/components/typography/_subtitle.html.erb +0 -11
- data/app/views/spree/home/index.html.erb +0 -7
- data/app/views/spree/layouts/spree_application.html.erb +0 -27
- data/app/views/spree/orders/edit.html.erb +0 -21
- data/app/views/spree/orders/show.html.erb +0 -29
- data/app/views/spree/products/index.html.erb +0 -22
- data/app/views/spree/products/show.html.erb +0 -18
- data/app/views/spree/shared/_image.html.erb +0 -12
- data/app/views/spree/shared/_link_to_cart.html.erb +0 -1
- data/app/views/spree/shared/_login_bar_items.html.erb +0 -1
- data/app/views/spree/shared/_shipment_tracking.html.erb +0 -11
- data/app/views/spree/shared/unauthorized.html.erb +0 -0
- data/app/views/spree/taxons/show.html.erb +0 -17
- data/bin/console +0 -17
- data/bin/r +0 -13
- data/bin/rails +0 -7
- data/bin/rake +0 -7
- data/bin/rspec +0 -29
- data/bin/sandbox +0 -84
- data/bin/sandbox_rails +0 -18
- data/bin/setup +0 -8
- data/bin/solidus_compare +0 -155
- data/config/initializers/assets.rb +0 -1
- data/config/initializers/canonical_rails.rb +0 -16
- data/config/locales/en.yml +0 -5
- data/config/routes.rb +0 -33
- data/config/solidus_compare.yml +0 -33
- data/docs/development.md +0 -28
- data/exe/solidus_starter_frontend +0 -9
- data/lib/generators/solidus_starter_frontend/install/install_generator.rb +0 -15
- data/lib/generators/solidus_starter_frontend/solidus_starter_frontend_generator.rb +0 -30
- data/lib/generators/solidus_starter_frontend/views/override_generator.rb +0 -50
- data/lib/solidus_starter_frontend/config.rb +0 -7
- data/lib/solidus_starter_frontend/engine.rb +0 -34
- data/lib/solidus_starter_frontend/factories.rb +0 -4
- data/lib/solidus_starter_frontend/solidus_support_extensions.rb +0 -9
- data/lib/solidus_starter_frontend/version.rb +0 -5
- data/lib/solidus_starter_frontend.rb +0 -12
- data/lib/solidus_starter_frontend_configuration.rb +0 -8
- data/lib/views/auth/spree/checkout/registration.html.erb +0 -7
- data/lib/views/auth/spree/components/navigation/_auth_link.html.erb +0 -5
- data/lib/views/auth/spree/user_passwords/edit.html.erb +0 -7
- data/lib/views/auth/spree/user_passwords/new.html.erb +0 -5
- data/lib/views/auth/spree/user_registrations/new.html.erb +0 -7
- data/lib/views/auth/spree/user_sessions/guest.html.erb +0 -5
- data/lib/views/auth/spree/user_sessions/new.html.erb +0 -7
- data/lib/views/auth/spree/users/edit.html.erb +0 -45
- data/lib/views/auth/spree/users/show.html.erb +0 -55
- data/solidus_starter_frontend.gemspec +0 -43
- data/spec/controllers/controller_helpers_spec.rb +0 -29
- data/spec/controllers/locale_controller_spec.rb +0 -57
- data/spec/controllers/spree/checkout_controller_spec.rb +0 -563
- data/spec/controllers/spree/checkout_controller_with_views_spec.rb +0 -37
- data/spec/controllers/spree/current_order_tracking_spec.rb +0 -33
- data/spec/controllers/spree/home_controller_spec.rb +0 -29
- data/spec/controllers/spree/orders_controller_ability_spec.rb +0 -90
- data/spec/controllers/spree/orders_controller_spec.rb +0 -241
- data/spec/controllers/spree/orders_controller_transitions_spec.rb +0 -33
- data/spec/controllers/spree/products_controller_spec.rb +0 -38
- data/spec/controllers/spree/taxons_controller_spec.rb +0 -14
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spec/generators/solidus/views/override_generator_spec.rb +0 -50
- data/spec/helpers/base_helper_spec.rb +0 -13
- data/spec/helpers/order_helper_spec.rb +0 -14
- data/spec/helpers/taxon_filters_helper_spec.rb +0 -12
- data/spec/spec_helper.rb +0 -64
- data/spec/support/shared_contexts/checkout_setup.rb +0 -12
- data/spec/support/shared_contexts/custom_products.rb +0 -28
- data/spec/support/shared_contexts/locales.rb +0 -16
- data/spec/system/address_spec.rb +0 -87
- data/spec/system/automatic_promotion_adjustments_spec.rb +0 -49
- data/spec/system/caching/products_spec.rb +0 -48
- data/spec/system/caching/taxons_spec.rb +0 -35
- data/spec/system/cart_spec.rb +0 -81
- data/spec/system/checkout_confirm_insufficient_stock_spec.rb +0 -71
- data/spec/system/checkout_spec.rb +0 -699
- data/spec/system/checkout_unshippable_spec.rb +0 -37
- data/spec/system/coupon_code_spec.rb +0 -267
- data/spec/system/currency_spec.rb +0 -20
- data/spec/system/first_order_promotion_spec.rb +0 -59
- data/spec/system/free_shipping_promotions_spec.rb +0 -60
- data/spec/system/locale_spec.rb +0 -26
- data/spec/system/order_spec.rb +0 -57
- data/spec/system/products_spec.rb +0 -302
- data/spec/system/promotion_code_invalidation_spec.rb +0 -54
- data/spec/system/quantity_promotions_spec.rb +0 -130
- data/spec/system/taxons_spec.rb +0 -158
- data/spec/system/template_rendering_spec.rb +0 -20
- data/spec/views/spree/checkout/_summary_spec.rb +0 -11
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'checkout with unshippable items', type: :system, inaccessible: true do
|
6
|
-
let!(:stock_location) { create(:stock_location) }
|
7
|
-
let(:order) { Spree::TestingSupport::OrderWalkthrough.up_to(:address) }
|
8
|
-
|
9
|
-
before do
|
10
|
-
create(:line_item, order: order)
|
11
|
-
order.reload
|
12
|
-
line_item = order.line_items.last
|
13
|
-
stock_item = stock_location.stock_item(line_item.variant)
|
14
|
-
stock_item.adjust_count_on_hand(0)
|
15
|
-
stock_item.backorderable = false
|
16
|
-
stock_item.save!
|
17
|
-
|
18
|
-
user = create(:user)
|
19
|
-
order.user = user
|
20
|
-
order.recalculate
|
21
|
-
|
22
|
-
allow_any_instance_of(Spree::CheckoutController).to receive_messages(current_order: order)
|
23
|
-
allow_any_instance_of(Spree::CheckoutController).to receive_messages(try_spree_current_user: user)
|
24
|
-
allow_any_instance_of(Spree::CheckoutController).to receive_messages(skip_state_validation?: true)
|
25
|
-
allow_any_instance_of(Spree::CheckoutController).to receive_messages(ensure_sufficient_stock_lines: true)
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'displays and removes' do
|
29
|
-
visit spree.checkout_state_path(:delivery)
|
30
|
-
expect(page).to have_content('Unshippable Items')
|
31
|
-
|
32
|
-
click_button "Save and Continue"
|
33
|
-
|
34
|
-
order.reload
|
35
|
-
expect(order.line_items.count).to eq 1
|
36
|
-
end
|
37
|
-
end
|
@@ -1,267 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'Coupon code promotions', type: :system, js: true do
|
6
|
-
let!(:store) { create(:store) }
|
7
|
-
let!(:country) { create(:country, name: "United States of America", states_required: true) }
|
8
|
-
let!(:state) { create(:state, name: "Alabama", country: country) }
|
9
|
-
let!(:zone) { create(:zone) }
|
10
|
-
let!(:shipping_method) { create(:shipping_method) }
|
11
|
-
let!(:payment_method) { create(:check_payment_method) }
|
12
|
-
let!(:product) { create(:product, name: "RoR Mug", price: 20) }
|
13
|
-
|
14
|
-
context "visitor makes checkout" do
|
15
|
-
def create_basic_coupon_promotion(code)
|
16
|
-
promotion = create(
|
17
|
-
:promotion,
|
18
|
-
name: code.titleize,
|
19
|
-
code: code,
|
20
|
-
starts_at: 1.day.ago,
|
21
|
-
expires_at: 1.day.from_now
|
22
|
-
)
|
23
|
-
|
24
|
-
calculator = Spree::Calculator::FlatRate.new
|
25
|
-
calculator.preferred_amount = 10
|
26
|
-
|
27
|
-
action = Spree::Promotion::Actions::CreateItemAdjustments.new
|
28
|
-
action.calculator = calculator
|
29
|
-
action.promotion = promotion
|
30
|
-
action.save
|
31
|
-
|
32
|
-
promotion.reload # so that promotion.actions is available
|
33
|
-
end
|
34
|
-
|
35
|
-
let!(:promotion) { create_basic_coupon_promotion("onetwo") }
|
36
|
-
|
37
|
-
context "on the payment page" do
|
38
|
-
context "as guest without registration" do
|
39
|
-
before do
|
40
|
-
visit spree.root_path
|
41
|
-
click_link "RoR Mug"
|
42
|
-
click_button "add-to-cart-button"
|
43
|
-
click_button "Checkout"
|
44
|
-
fill_in "order_email", with: "spree@example.com"
|
45
|
-
fill_in "First Name", with: "John"
|
46
|
-
fill_in "Last Name", with: "Smith"
|
47
|
-
fill_in 'Street Address:', with: '1 John Street'
|
48
|
-
fill_in "City", with: "City of John"
|
49
|
-
fill_in "Zip", with: "01337"
|
50
|
-
select country.name, from: "Country"
|
51
|
-
select state.name, from: "order[bill_address_attributes][state_id]"
|
52
|
-
fill_in "Phone", with: "555-555-5555"
|
53
|
-
|
54
|
-
# To shipping method screen
|
55
|
-
click_button "Save and Continue"
|
56
|
-
# To payment screen
|
57
|
-
click_button "Save and Continue"
|
58
|
-
end
|
59
|
-
|
60
|
-
it "informs about an invalid coupon code" do
|
61
|
-
fill_in "order_coupon_code", with: "coupon_codes_rule_man"
|
62
|
-
click_button "Apply Code"
|
63
|
-
expect(page).to have_content(I18n.t('spree.coupon_code_not_found'))
|
64
|
-
end
|
65
|
-
|
66
|
-
it "can enter an invalid coupon code, then a real one" do
|
67
|
-
fill_in "order_coupon_code", with: "coupon_codes_rule_man"
|
68
|
-
click_button "Apply Code"
|
69
|
-
expect(page).to have_content(I18n.t('spree.coupon_code_not_found'))
|
70
|
-
fill_in "order_coupon_code", with: "onetwo"
|
71
|
-
click_button "Apply Code"
|
72
|
-
expect(page).to have_content("Promotion (Onetwo) -$10.00", normalize_ws: true)
|
73
|
-
end
|
74
|
-
|
75
|
-
context "with a promotion" do
|
76
|
-
it "applies a promotion to an order" do
|
77
|
-
fill_in "order_coupon_code", with: "onetwo"
|
78
|
-
click_button "Apply Code"
|
79
|
-
expect(page).to have_content("Promotion (Onetwo) -$10.00", normalize_ws: true)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
context 'as logged user' do
|
85
|
-
let!(:user) { create(:user, bill_address: create(:address), ship_address: create(:address)) }
|
86
|
-
|
87
|
-
before do
|
88
|
-
allow_any_instance_of(Spree::CheckoutController).to receive_messages(try_spree_current_user: user)
|
89
|
-
allow_any_instance_of(Spree::OrdersController).to receive_messages(try_spree_current_user: user)
|
90
|
-
allow_any_instance_of(Spree::CouponCodesController).to receive_messages(try_spree_current_user: user)
|
91
|
-
end
|
92
|
-
|
93
|
-
context 'with saved credit card' do
|
94
|
-
let(:bogus) { create(:credit_card_payment_method) }
|
95
|
-
let!(:credit_card) do
|
96
|
-
create(:credit_card, user_id: user.id, payment_method: bogus, gateway_customer_profile_id: "BGS-WEFWF")
|
97
|
-
end
|
98
|
-
|
99
|
-
before do
|
100
|
-
user.wallet.add(credit_card)
|
101
|
-
|
102
|
-
visit spree.root_path
|
103
|
-
click_link "RoR Mug"
|
104
|
-
click_button "add-to-cart-button"
|
105
|
-
# To Cart
|
106
|
-
click_button "Checkout"
|
107
|
-
# To shipping method screen, address is auto-populated
|
108
|
-
# with user's saved addresses
|
109
|
-
click_button "Save and Continue"
|
110
|
-
# To payment screen
|
111
|
-
click_button "Save and Continue"
|
112
|
-
end
|
113
|
-
|
114
|
-
it "shows wallet payments on coupon code errors" do
|
115
|
-
fill_in "order_coupon_code", with: "coupon_codes_rule_man"
|
116
|
-
click_button "Apply Code"
|
117
|
-
|
118
|
-
expect(page).to have_content("The coupon code you entered doesn't exist. Please try again.")
|
119
|
-
expect(page).to have_content("Use an existing card")
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
# CheckoutController
|
126
|
-
context "on the cart page" do
|
127
|
-
before do
|
128
|
-
visit spree.root_path
|
129
|
-
click_link "RoR Mug"
|
130
|
-
click_button "add-to-cart-button"
|
131
|
-
end
|
132
|
-
|
133
|
-
it "can enter a coupon code and receives success notification" do
|
134
|
-
fill_in "coupon_code", with: "onetwo"
|
135
|
-
click_button "Apply Code"
|
136
|
-
expect(page).to have_content(I18n.t('spree.coupon_code_applied'))
|
137
|
-
end
|
138
|
-
|
139
|
-
it "can enter a promotion code with both upper and lower case letters" do
|
140
|
-
fill_in "coupon_code", with: "ONETwO"
|
141
|
-
click_button "Apply Code"
|
142
|
-
expect(page).to have_content(I18n.t('spree.coupon_code_applied'))
|
143
|
-
end
|
144
|
-
|
145
|
-
it "informs the user about a coupon code which has exceeded its usage" do
|
146
|
-
expect_any_instance_of(Spree::Promotion).to receive(:usage_limit_exceeded?).and_return(true)
|
147
|
-
|
148
|
-
fill_in "coupon_code", with: "onetwo"
|
149
|
-
click_button "Apply Code"
|
150
|
-
expect(page).to have_content(I18n.t('spree.coupon_code_max_usage'))
|
151
|
-
end
|
152
|
-
|
153
|
-
context "informs the user if the coupon code is not eligible" do
|
154
|
-
before do
|
155
|
-
rule = Spree::Promotion::Rules::ItemTotal.new
|
156
|
-
rule.promotion = promotion
|
157
|
-
rule.preferred_amount = 100
|
158
|
-
rule.save
|
159
|
-
end
|
160
|
-
|
161
|
-
specify do
|
162
|
-
visit spree.cart_path
|
163
|
-
|
164
|
-
fill_in "coupon_code", with: "onetwo"
|
165
|
-
click_button "Apply Code"
|
166
|
-
expect(page).to have_content(I18n.t(:item_total_less_than_or_equal, scope: [:spree, :eligibility_errors, :messages], amount: "$100.00"))
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
it "informs the user if the coupon is expired" do
|
171
|
-
promotion.expires_at = Date.today.beginning_of_week
|
172
|
-
promotion.starts_at = Date.today.beginning_of_week.advance(day: 3)
|
173
|
-
promotion.save!
|
174
|
-
fill_in "coupon_code", with: "onetwo"
|
175
|
-
click_button "Apply Code"
|
176
|
-
expect(page).to have_content(I18n.t('spree.coupon_code_expired'))
|
177
|
-
end
|
178
|
-
|
179
|
-
context "calculates the correct amount of money saved with flat percent promotions" do
|
180
|
-
before do
|
181
|
-
calculator = Spree::Calculator::FlatPercentItemTotal.new
|
182
|
-
calculator.preferred_flat_percent = 20
|
183
|
-
promotion.actions.first.calculator = calculator
|
184
|
-
promotion.save
|
185
|
-
|
186
|
-
create(:product, name: "Spree Mug", price: 10)
|
187
|
-
end
|
188
|
-
|
189
|
-
specify do
|
190
|
-
visit spree.root_path
|
191
|
-
click_link "Spree Mug"
|
192
|
-
click_button "add-to-cart-button"
|
193
|
-
|
194
|
-
visit spree.cart_path
|
195
|
-
fill_in "coupon_code", with: "onetwo"
|
196
|
-
click_button "Apply Code"
|
197
|
-
|
198
|
-
fill_in "order_line_items_attributes_0_quantity", with: 2
|
199
|
-
fill_in "order_line_items_attributes_1_quantity", with: 2
|
200
|
-
click_button "Update"
|
201
|
-
|
202
|
-
within '#cart_adjustments' do
|
203
|
-
# 20% of $40 = 8
|
204
|
-
# 20% of $20 = 4
|
205
|
-
# Therefore: promotion discount amount is $12.
|
206
|
-
expect(page).to have_content("Promotion (Onetwo) -$12.00", normalize_ws: true)
|
207
|
-
end
|
208
|
-
|
209
|
-
within '.cart-footer__total' do
|
210
|
-
expect(page).to have_content("$48.00")
|
211
|
-
end
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
|
-
context "calculates the correct amount of money saved with flat 100% promotions on the whole order" do
|
216
|
-
before do
|
217
|
-
calculator = Spree::Calculator::FlatPercentItemTotal.new
|
218
|
-
calculator.preferred_flat_percent = 100
|
219
|
-
|
220
|
-
promotion.promotion_actions.first.discard
|
221
|
-
|
222
|
-
Spree::Promotion::Actions::CreateAdjustment.create!(
|
223
|
-
calculator: calculator,
|
224
|
-
promotion: promotion
|
225
|
-
)
|
226
|
-
|
227
|
-
create(:product, name: "Spree Mug", price: 10)
|
228
|
-
end
|
229
|
-
|
230
|
-
specify do
|
231
|
-
visit spree.root_path
|
232
|
-
click_link "Spree Mug"
|
233
|
-
click_button "add-to-cart-button"
|
234
|
-
|
235
|
-
visit spree.cart_path
|
236
|
-
|
237
|
-
within '.cart-footer__total' do
|
238
|
-
expect(page).to have_content("$30.00")
|
239
|
-
end
|
240
|
-
|
241
|
-
fill_in "coupon_code", with: "onetwo"
|
242
|
-
click_button "Apply Code"
|
243
|
-
|
244
|
-
within '#cart_adjustments' do
|
245
|
-
expect(page).to have_content("Promotion (Onetwo) -$30.00", normalize_ws: true)
|
246
|
-
end
|
247
|
-
|
248
|
-
within '.cart-footer__total' do
|
249
|
-
expect(page).to have_content("$0.00")
|
250
|
-
end
|
251
|
-
|
252
|
-
fill_in "order_line_items_attributes_0_quantity", with: 2
|
253
|
-
fill_in "order_line_items_attributes_1_quantity", with: 2
|
254
|
-
click_button "Update"
|
255
|
-
|
256
|
-
within '#cart_adjustments' do
|
257
|
-
expect(page).to have_content("Promotion (Onetwo) -$60.00", normalize_ws: true)
|
258
|
-
end
|
259
|
-
|
260
|
-
within '.cart-footer__total' do
|
261
|
-
expect(page).to have_content("$0.00")
|
262
|
-
end
|
263
|
-
end
|
264
|
-
end
|
265
|
-
end
|
266
|
-
end
|
267
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'Switching currencies in backend', type: :system do
|
6
|
-
before do
|
7
|
-
create(:store)
|
8
|
-
create(:base_product, name: "RoR Mug")
|
9
|
-
end
|
10
|
-
|
11
|
-
# Regression test for https://github.com/spree/spree/issues/2340
|
12
|
-
it "does not cause current_order to become nil", inaccessible: true do
|
13
|
-
visit spree.root_path
|
14
|
-
click_link "RoR Mug"
|
15
|
-
click_button "Add To Cart"
|
16
|
-
# Now that we have an order...
|
17
|
-
stub_spree_preferences(currency: "AUD")
|
18
|
-
visit spree.root_path
|
19
|
-
end
|
20
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'First Order promotion', type: :system do
|
6
|
-
let!(:promotion) do
|
7
|
-
FactoryBot.create(
|
8
|
-
:promotion_with_first_order_rule,
|
9
|
-
:with_order_adjustment,
|
10
|
-
code: "FIRSTONEFREE",
|
11
|
-
per_code_usage_limit: 10
|
12
|
-
)
|
13
|
-
end
|
14
|
-
|
15
|
-
before do
|
16
|
-
create(:store)
|
17
|
-
product = FactoryBot.create(:product)
|
18
|
-
visit spree.root_path
|
19
|
-
click_link product.name
|
20
|
-
click_button "Add To Cart"
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'Adding first order promotion to cart and checking out as guest' do
|
24
|
-
fill_in "Coupon code", with: "FIRSTONEFREE"
|
25
|
-
click_button "Apply Code"
|
26
|
-
expect(page).to have_content("The coupon code was successfully applied to your order")
|
27
|
-
|
28
|
-
within("#cart_adjustments") do
|
29
|
-
expect(page).to have_content("-$10.00")
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'Trying to reuse first order promotion', js: true do
|
34
|
-
previous_user = FactoryBot.create(
|
35
|
-
:user,
|
36
|
-
email: "sam@tom.com"
|
37
|
-
)
|
38
|
-
_previous_order = create(:completed_order_with_totals, user: previous_user)
|
39
|
-
fill_in "Coupon code", with: "FIRSTONEFREE"
|
40
|
-
click_button "Apply Code"
|
41
|
-
expect(page).to have_content("The coupon code was successfully applied to your order")
|
42
|
-
click_on "Checkout"
|
43
|
-
fill_in "Customer E-Mail", with: "sam@tom.com"
|
44
|
-
fill_in_address
|
45
|
-
click_on "Save and Continue"
|
46
|
-
expect(page).to_not have_content("#summary-order-charges")
|
47
|
-
end
|
48
|
-
|
49
|
-
def fill_in_address
|
50
|
-
address = "order_bill_address_attributes"
|
51
|
-
fill_in "#{address}_firstname", with: "Ryan"
|
52
|
-
fill_in "#{address}_lastname", with: "Bigg"
|
53
|
-
fill_in "#{address}_address1", with: "143 Swan Street"
|
54
|
-
fill_in "#{address}_city", with: "Richmond"
|
55
|
-
select "United States of America", from: "#{address}_country_id"
|
56
|
-
fill_in "#{address}_zipcode", with: "12345"
|
57
|
-
fill_in "#{address}_phone", with: "(555) 555-5555"
|
58
|
-
end
|
59
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'Free shipping promotions', type: :system, js: true do
|
6
|
-
let!(:store) { create(:store) }
|
7
|
-
let!(:country) { create(:country, name: "United States of America", states_required: true) }
|
8
|
-
let!(:state) { create(:state, name: "Alabama", country: country) }
|
9
|
-
let!(:zone) { create(:zone) }
|
10
|
-
let!(:shipping_method) do
|
11
|
-
sm = create(:shipping_method)
|
12
|
-
sm.calculator.preferred_amount = 10
|
13
|
-
sm.calculator.save
|
14
|
-
sm
|
15
|
-
end
|
16
|
-
|
17
|
-
let!(:payment_method) { create(:check_payment_method) }
|
18
|
-
let!(:product) { create(:product, name: "RoR Mug", price: 20) }
|
19
|
-
let!(:promotion) do
|
20
|
-
create(
|
21
|
-
:promotion,
|
22
|
-
apply_automatically: true,
|
23
|
-
promotion_actions: [Spree::Promotion::Actions::FreeShipping.new],
|
24
|
-
name: "Free Shipping",
|
25
|
-
starts_at: 1.day.ago,
|
26
|
-
expires_at: 1.day.from_now,
|
27
|
-
)
|
28
|
-
end
|
29
|
-
|
30
|
-
context "free shipping promotion automatically applied" do
|
31
|
-
before do
|
32
|
-
visit spree.root_path
|
33
|
-
click_link "RoR Mug"
|
34
|
-
click_button "add-to-cart-button"
|
35
|
-
click_button "Checkout"
|
36
|
-
fill_in "order_email", with: "spree@example.com"
|
37
|
-
fill_in "First Name", with: "John"
|
38
|
-
fill_in "Last Name", with: "Smith"
|
39
|
-
fill_in 'Street Address:', with: '1 John Street'
|
40
|
-
fill_in "City", with: "City of John"
|
41
|
-
fill_in "Zip", with: "01337"
|
42
|
-
select country.name, from: "Country"
|
43
|
-
select state.name, from: "order[bill_address_attributes][state_id]"
|
44
|
-
fill_in "Phone", with: "555-555-5555"
|
45
|
-
|
46
|
-
# To shipping method screen
|
47
|
-
click_button "Save and Continue"
|
48
|
-
# To payment screen
|
49
|
-
click_button "Save and Continue"
|
50
|
-
end
|
51
|
-
|
52
|
-
# Regression test for https://github.com/spree/spree/issues/4428
|
53
|
-
it "applies the free shipping promotion" do
|
54
|
-
within("#checkout-summary") do
|
55
|
-
expect(page).to have_content("Shipping total: $10.00", normalize_ws: true)
|
56
|
-
expect(page).to have_content("Promotion (Free Shipping): -$10.00", normalize_ws: true)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
data/spec/system/locale_spec.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'setting locale', type: :system do
|
6
|
-
let!(:store) { create(:store) }
|
7
|
-
def with_locale(locale)
|
8
|
-
I18n.locale = locale
|
9
|
-
stub_spree_preferences(SolidusStarterFrontend::Config, locale: locale)
|
10
|
-
yield
|
11
|
-
ensure
|
12
|
-
I18n.locale = I18n.default_locale
|
13
|
-
end
|
14
|
-
|
15
|
-
context 'shopping cart link and page' do
|
16
|
-
include_context "fr locale"
|
17
|
-
|
18
|
-
it 'should be in french' do
|
19
|
-
with_locale('fr') do
|
20
|
-
visit spree.root_path
|
21
|
-
click_link 'Panier'
|
22
|
-
expect(page).to have_content('Panier')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
data/spec/system/order_spec.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'orders', type: :system do
|
6
|
-
let(:order) { Spree::TestingSupport::OrderWalkthrough.up_to(:complete) }
|
7
|
-
let(:user) { create(:user) }
|
8
|
-
|
9
|
-
before do
|
10
|
-
order.update_attribute(:user_id, user.id)
|
11
|
-
allow_any_instance_of(Spree::OrdersController).to receive_messages(try_spree_current_user: user)
|
12
|
-
end
|
13
|
-
|
14
|
-
it "can visit an order" do
|
15
|
-
# Regression test for current_user call on orders/show
|
16
|
-
visit spree.order_path(order)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should display line item price" do
|
20
|
-
# Regression test for https://github.com/spree/spree/issues/2772
|
21
|
-
line_item = order.line_items.first
|
22
|
-
line_item.target_shipment = create(:shipment)
|
23
|
-
line_item.price = 19.00
|
24
|
-
line_item.save!
|
25
|
-
|
26
|
-
visit spree.order_path(order)
|
27
|
-
|
28
|
-
# Tests view spree/shared/_order_details
|
29
|
-
within '.order-item__price-single' do
|
30
|
-
expect(page).to have_content "19.00"
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
it "should have credit card info if paid with credit card" do
|
35
|
-
create(:payment, order: order)
|
36
|
-
visit spree.order_path(order)
|
37
|
-
within '.payment-info' do
|
38
|
-
expect(page).to have_content "Ending in 1111"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should have payment method name visible if not paid with credit card" do
|
43
|
-
create(:check_payment, order: order)
|
44
|
-
visit spree.order_path(order)
|
45
|
-
within '.payment-info' do
|
46
|
-
expect(page).to have_content "Check"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
it "should return the correct title when displaying a completed order" do
|
51
|
-
visit spree.order_path(order)
|
52
|
-
|
53
|
-
within '#order_summary' do
|
54
|
-
expect(page).to have_content("#{I18n.t('spree.order')} #{order.number}")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|