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
data/spec/system/address_spec.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'Address', type: :system, inaccessible: true do
|
6
|
-
let!(:product) { create(:product, name: "RoR Mug") }
|
7
|
-
let!(:order) { create(:order_with_totals, state: 'cart') }
|
8
|
-
|
9
|
-
stub_authorization!
|
10
|
-
|
11
|
-
before do
|
12
|
-
visit spree.root_path
|
13
|
-
|
14
|
-
click_link 'RoR Mug'
|
15
|
-
click_button 'add-to-cart-button'
|
16
|
-
|
17
|
-
address = 'order_bill_address_attributes'
|
18
|
-
@state_select_css = "##{address}_state_id"
|
19
|
-
@state_name_css = "##{address}_state_name"
|
20
|
-
end
|
21
|
-
|
22
|
-
context 'country requires state', js: true do
|
23
|
-
let!(:canada) { create(:country, name: 'Canada', states_required: true, iso: 'CA') }
|
24
|
-
let!(:uk) { create(:country, name: 'United Kingdom', states_required: true, iso: 'GB') }
|
25
|
-
|
26
|
-
before { stub_spree_preferences(default_country_iso: uk.iso) }
|
27
|
-
|
28
|
-
context 'but has no state' do
|
29
|
-
it 'shows the state input field' do
|
30
|
-
click_button 'Checkout'
|
31
|
-
|
32
|
-
within('#billing') do
|
33
|
-
select canada.name, from: 'Country'
|
34
|
-
expect(page).to have_no_css(@state_select_css)
|
35
|
-
expect(page).to have_css("#{@state_name_css}.required")
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'and has state' do
|
41
|
-
before { create(:state, name: 'Ontario', country: canada) }
|
42
|
-
|
43
|
-
it 'shows the state collection selection' do
|
44
|
-
click_button 'Checkout'
|
45
|
-
|
46
|
-
within('#billing') do
|
47
|
-
select canada.name, from: 'Country'
|
48
|
-
expect(page).to have_no_css(@state_name_css)
|
49
|
-
expect(page).to have_css("#{@state_select_css}.required")
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
context 'user changes to country without states required' do
|
55
|
-
let!(:france) { create(:country, name: 'France', states_required: false, iso: 'FR') }
|
56
|
-
|
57
|
-
it 'clears the state name' do
|
58
|
-
click_button 'Checkout'
|
59
|
-
within('#billing') do
|
60
|
-
select canada.name, from: 'Country'
|
61
|
-
|
62
|
-
page.find(@state_name_css).set('Toscana')
|
63
|
-
|
64
|
-
select france.name, from: 'Country'
|
65
|
-
|
66
|
-
expect(page).to have_no_css(@state_name_css)
|
67
|
-
expect(page).to have_no_css(@state_select_css)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
context 'country does not require state', js: true do
|
74
|
-
let!(:france) { create(:country, name: 'France', states_required: false, iso: 'FR') }
|
75
|
-
|
76
|
-
it 'shows a disabled state input field' do
|
77
|
-
click_button 'Checkout'
|
78
|
-
|
79
|
-
within('#billing') do
|
80
|
-
select france.name, from: 'Country'
|
81
|
-
|
82
|
-
expect(page).to have_no_css(@state_name_css)
|
83
|
-
expect(page).to have_css("#{@state_select_css}[disabled]", visible: false)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'Automatic 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
|
-
let!(:promotion) do
|
15
|
-
promotion = Spree::Promotion.create!(name: "$10 off when you spend more than $100", apply_automatically: true)
|
16
|
-
|
17
|
-
calculator = Spree::Calculator::FlatRate.new
|
18
|
-
calculator.preferred_amount = 10
|
19
|
-
|
20
|
-
rule = Spree::Promotion::Rules::ItemTotal.create
|
21
|
-
rule.preferred_amount = 100
|
22
|
-
rule.save
|
23
|
-
|
24
|
-
promotion.rules << rule
|
25
|
-
|
26
|
-
action = Spree::Promotion::Actions::CreateAdjustment.create
|
27
|
-
action.calculator = calculator
|
28
|
-
action.save
|
29
|
-
|
30
|
-
promotion.actions << action
|
31
|
-
end
|
32
|
-
|
33
|
-
context "on the cart page" do
|
34
|
-
before do
|
35
|
-
visit spree.root_path
|
36
|
-
click_link product.name
|
37
|
-
click_button "add-to-cart-button"
|
38
|
-
end
|
39
|
-
|
40
|
-
it "automatically applies the promotion once the order crosses the threshold" do
|
41
|
-
fill_in "order_line_items_attributes_0_quantity", with: 10
|
42
|
-
click_button "Update"
|
43
|
-
expect(page).to have_content("Promotion ($10 off when you spend more than $100) -$10.00", normalize_ws: true)
|
44
|
-
fill_in "order_line_items_attributes_0_quantity", with: 1
|
45
|
-
click_button "Update"
|
46
|
-
expect(page).not_to have_content("Promotion ($10 off when you spend more than $100) -$10.00", normalize_ws: true)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'products', type: :system, caching: true do
|
6
|
-
let!(:product) { create(:product) }
|
7
|
-
let!(:product2) { create(:product) }
|
8
|
-
let!(:taxonomy) { create(:taxonomy) }
|
9
|
-
let!(:taxon) { create(:taxon, taxonomy: taxonomy) }
|
10
|
-
|
11
|
-
before do
|
12
|
-
product2.update_column(:updated_at, 1.day.ago)
|
13
|
-
# warm up the cache
|
14
|
-
visit spree.root_path
|
15
|
-
|
16
|
-
clear_cache_events
|
17
|
-
end
|
18
|
-
|
19
|
-
it "reads from cache upon a second viewing" do
|
20
|
-
visit spree.root_path
|
21
|
-
expect(cache_writes.count).to eq(0)
|
22
|
-
end
|
23
|
-
|
24
|
-
it "busts the cache when a product is updated" do
|
25
|
-
product.update_column(:updated_at, 1.day.from_now)
|
26
|
-
visit spree.root_path
|
27
|
-
expect(cache_writes.count).to eq(2)
|
28
|
-
end
|
29
|
-
|
30
|
-
it "busts the cache when all products are soft-deleted" do
|
31
|
-
product.discard
|
32
|
-
product2.discard
|
33
|
-
visit spree.root_path
|
34
|
-
expect(cache_writes.count).to eq(1)
|
35
|
-
end
|
36
|
-
|
37
|
-
it "busts the cache when the newest product is soft-deleted" do
|
38
|
-
product.discard
|
39
|
-
visit spree.root_path
|
40
|
-
expect(cache_writes.count).to eq(1)
|
41
|
-
end
|
42
|
-
|
43
|
-
it "busts the cache when an older product is soft-deleted" do
|
44
|
-
product2.discard
|
45
|
-
visit spree.root_path
|
46
|
-
expect(cache_writes.count).to eq(1)
|
47
|
-
end
|
48
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'taxons', type: :system, caching: true do
|
6
|
-
let!(:taxonomy) { create(:taxonomy) }
|
7
|
-
let!(:taxon) { create(:taxon, taxonomy: taxonomy, parent: taxonomy.root) }
|
8
|
-
|
9
|
-
before do
|
10
|
-
# Warm up the cache
|
11
|
-
visit spree.products_path
|
12
|
-
|
13
|
-
clear_cache_events
|
14
|
-
end
|
15
|
-
|
16
|
-
it "busts the cache when a taxon changes" do
|
17
|
-
taxon.touch(:updated_at)
|
18
|
-
|
19
|
-
visit spree.products_path
|
20
|
-
# Cache rewrites:
|
21
|
-
# - 2 x categories component
|
22
|
-
# - 1 x taxons list in search form
|
23
|
-
# - 1 x categories in navigation
|
24
|
-
expect(cache_writes.count).to eq(4)
|
25
|
-
end
|
26
|
-
|
27
|
-
it "busts the cache when max_level_in_taxons_menu conf changes" do
|
28
|
-
stub_spree_preferences(max_level_in_taxons_menu: 5)
|
29
|
-
visit spree.products_path
|
30
|
-
|
31
|
-
# Cache rewrites:
|
32
|
-
# - 2 x categories component
|
33
|
-
expect(cache_writes.count).to eq(2)
|
34
|
-
end
|
35
|
-
end
|
data/spec/system/cart_spec.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'Cart', type: :system, inaccessible: true do
|
6
|
-
before { create(:store) }
|
7
|
-
|
8
|
-
it "shows cart icon on non-cart pages" do
|
9
|
-
visit spree.root_path
|
10
|
-
expect(page).to have_selector("#link-to-cart a", visible: true)
|
11
|
-
end
|
12
|
-
|
13
|
-
it "prevents double clicking the remove button on cart", js: true do
|
14
|
-
@product = create(:product, name: "RoR Mug")
|
15
|
-
|
16
|
-
visit spree.root_path
|
17
|
-
click_link "RoR Mug"
|
18
|
-
click_button "add-to-cart-button"
|
19
|
-
|
20
|
-
# prevent form submit to verify button is disabled
|
21
|
-
page.execute_script("$('#update-cart').submit(function(){return false;})")
|
22
|
-
|
23
|
-
expect(page).not_to have_selector('button#update-button[disabled]')
|
24
|
-
find('.delete').click
|
25
|
-
expect(page).to have_selector('button#update-button[disabled]')
|
26
|
-
end
|
27
|
-
|
28
|
-
# Regression test for https://github.com/spree/spree/issues/2006
|
29
|
-
it "does not error out with a 404 when GET'ing to /orders/populate" do
|
30
|
-
visit '/orders/populate'
|
31
|
-
within(".error") do
|
32
|
-
expect(page).to have_content(I18n.t('spree.populate_get_error'))
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'allows you to remove an item from the cart', js: true do
|
37
|
-
create(:product, name: "RoR Mug")
|
38
|
-
visit spree.root_path
|
39
|
-
click_link "RoR Mug"
|
40
|
-
click_button "add-to-cart-button"
|
41
|
-
find('.delete').click
|
42
|
-
expect(page).not_to have_content("Line items quantity must be an integer")
|
43
|
-
expect(page).not_to have_content("RoR Mug")
|
44
|
-
expect(page).to have_content("Your cart is empty")
|
45
|
-
|
46
|
-
within "#link-to-cart" do
|
47
|
-
expect(page).to have_content(/empty/i)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'allows you to empty the cart', js: true do
|
52
|
-
create(:product, name: "RoR Mug")
|
53
|
-
visit spree.root_path
|
54
|
-
click_link "RoR Mug"
|
55
|
-
click_button "add-to-cart-button"
|
56
|
-
|
57
|
-
expect(page).to have_content("RoR Mug")
|
58
|
-
click_on "Empty Cart"
|
59
|
-
expect(page).to have_content("Your cart is empty")
|
60
|
-
|
61
|
-
within "#link-to-cart" do
|
62
|
-
expect(page).to have_content(/empty/i)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# regression for https://github.com/spree/spree/issues/2276
|
67
|
-
context "product contains variants but no option values" do
|
68
|
-
let(:variant) { create(:variant) }
|
69
|
-
let(:product) { variant.product }
|
70
|
-
|
71
|
-
before { variant.option_values.destroy_all }
|
72
|
-
|
73
|
-
it "still adds product to cart", inaccessible: true do
|
74
|
-
visit spree.product_path(product)
|
75
|
-
click_button "add-to-cart-button"
|
76
|
-
|
77
|
-
visit spree.cart_path
|
78
|
-
expect(page).to have_content(product.name)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
describe 'Checkout confirm page submission', type: :system do
|
6
|
-
include_context 'checkout setup'
|
7
|
-
|
8
|
-
context "when the product from the order is not backorderable but has enough stock quantity" do
|
9
|
-
let(:user) { create(:user) }
|
10
|
-
|
11
|
-
let(:order) { Spree::TestingSupport::OrderWalkthrough.up_to(:payment) }
|
12
|
-
let(:order_product) { order.products.first }
|
13
|
-
let(:order_stock_item) { order_product.stock_items.first }
|
14
|
-
|
15
|
-
before do
|
16
|
-
order_stock_item.update! backorderable: false
|
17
|
-
order_stock_item.set_count_on_hand(1)
|
18
|
-
allow_any_instance_of(Spree::CheckoutController).to receive_messages(current_order: order)
|
19
|
-
allow_any_instance_of(Spree::CheckoutController).to receive_messages(try_spree_current_user: user)
|
20
|
-
allow_any_instance_of(Spree::OrdersController).to receive_messages(try_spree_current_user: user)
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'when there are not other backorderable stock locations' do
|
24
|
-
context 'when the customer is on the confirm page and the availabilty drops to zero' do
|
25
|
-
before do
|
26
|
-
visit spree.checkout_state_path(:confirm)
|
27
|
-
order_stock_item.set_count_on_hand(0)
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'redirects to cart page and shows an unavailable product message' do
|
31
|
-
click_button "Place Order"
|
32
|
-
expect(page).to have_content "#{order_product.name} became unavailable"
|
33
|
-
expect(page).to have_current_path spree.cart_path
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
context 'when there is another backorderable stock location' do
|
39
|
-
before do
|
40
|
-
create :stock_location, backorderable_default: true, default: false
|
41
|
-
end
|
42
|
-
|
43
|
-
context 'when the customer is on the confirm page and the availabilty drops to zero' do
|
44
|
-
before do
|
45
|
-
visit spree.checkout_state_path(:confirm)
|
46
|
-
order_stock_item.set_count_on_hand(0)
|
47
|
-
end
|
48
|
-
|
49
|
-
it "redirects to the address checkout page and shows an availability changed message" do
|
50
|
-
click_button "Place Order"
|
51
|
-
error_message = "Quantity selected of #{order_product.name} is not available. Still, items may be available from another stock location, please try again."
|
52
|
-
expect(page).to have_content error_message
|
53
|
-
expect(page).to have_current_path spree.checkout_state_path(:address)
|
54
|
-
end
|
55
|
-
|
56
|
-
it "can still complete the order using the backorderable stock location by restarting the checkout" do
|
57
|
-
click_button "Place Order"
|
58
|
-
expect(page).to have_current_path spree.checkout_state_path(:address)
|
59
|
-
click_button "Save and Continue"
|
60
|
-
expect(page).to have_current_path spree.checkout_state_path(:delivery)
|
61
|
-
click_button "Save and Continue"
|
62
|
-
expect(page).to have_current_path spree.checkout_state_path(:payment)
|
63
|
-
click_button "Save and Continue"
|
64
|
-
expect(page).to have_current_path spree.checkout_state_path(:confirm)
|
65
|
-
click_button "Place Order"
|
66
|
-
expect(page).to have_content 'Your order has been processed successfully'
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|