solidus_backend 2.5.2 → 2.6.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +5 -3
- data/app/assets/javascripts/spree/backend.js +1 -0
- data/app/assets/javascripts/spree/backend/admin.js +1 -0
- data/app/assets/javascripts/spree/backend/highlight_negative_numbers.js +14 -0
- data/app/assets/javascripts/spree/backend/locale_selection.js +18 -0
- data/app/assets/javascripts/spree/backend/templates/products/sortable.hbs +1 -1
- data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +11 -2
- data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +3 -1
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +6 -2
- data/app/assets/stylesheets/spree/backend/globals/_functions.scss +1 -2
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +3 -0
- data/app/controllers/spree/admin/adjustment_reasons_controller.rb +2 -0
- data/app/controllers/spree/admin/adjustments_controller.rb +2 -0
- data/app/controllers/spree/admin/base_controller.rb +2 -0
- data/app/controllers/spree/admin/cancellations_controller.rb +2 -0
- data/app/controllers/spree/admin/customer_returns_controller.rb +2 -0
- data/app/controllers/spree/admin/dashboards_controller.rb +2 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +2 -0
- data/app/controllers/spree/admin/images_controller.rb +2 -0
- data/app/controllers/spree/admin/locale_controller.rb +24 -0
- data/app/controllers/spree/admin/log_entries_controller.rb +2 -0
- data/app/controllers/spree/admin/option_types_controller.rb +2 -0
- data/app/controllers/spree/admin/option_values_controller.rb +2 -0
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -0
- data/app/controllers/spree/admin/orders_controller.rb +4 -2
- data/app/controllers/spree/admin/payment_methods_controller.rb +2 -0
- data/app/controllers/spree/admin/payments_controller.rb +2 -0
- data/app/controllers/spree/admin/prices_controller.rb +2 -0
- data/app/controllers/spree/admin/product_properties_controller.rb +2 -0
- data/app/controllers/spree/admin/products_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_actions_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_categories_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_code_batches_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_codes_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_rules_controller.rb +6 -0
- data/app/controllers/spree/admin/promotions_controller.rb +2 -0
- data/app/controllers/spree/admin/properties_controller.rb +2 -0
- data/app/controllers/spree/admin/refund_reasons_controller.rb +2 -0
- data/app/controllers/spree/admin/refunds_controller.rb +2 -0
- data/app/controllers/spree/admin/reimbursement_types_controller.rb +2 -0
- data/app/controllers/spree/admin/reimbursements_controller.rb +2 -0
- data/app/controllers/spree/admin/reports_controller.rb +2 -0
- data/app/controllers/spree/admin/resource_controller.rb +2 -0
- data/app/controllers/spree/admin/return_authorizations_controller.rb +2 -0
- data/app/controllers/spree/admin/return_items_controller.rb +2 -0
- data/app/controllers/spree/admin/return_reasons_controller.rb +2 -0
- data/app/controllers/spree/admin/root_controller.rb +2 -0
- data/app/controllers/spree/admin/search_controller.rb +2 -0
- data/app/controllers/spree/admin/shipping_categories_controller.rb +2 -0
- data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -0
- data/app/controllers/spree/admin/stock_items_controller.rb +2 -0
- data/app/controllers/spree/admin/stock_locations_controller.rb +2 -1
- data/app/controllers/spree/admin/stock_movements_controller.rb +2 -0
- data/app/controllers/spree/admin/store_credits_controller.rb +2 -0
- data/app/controllers/spree/admin/stores_controller.rb +2 -0
- data/app/controllers/spree/admin/style_guide_controller.rb +2 -0
- data/app/controllers/spree/admin/tax_categories_controller.rb +2 -0
- data/app/controllers/spree/admin/tax_rates_controller.rb +2 -0
- data/app/controllers/spree/admin/taxonomies_controller.rb +2 -0
- data/app/controllers/spree/admin/taxons_controller.rb +2 -0
- data/app/controllers/spree/admin/users_controller.rb +4 -1
- data/app/controllers/spree/admin/variant_property_rule_values_controller.rb +2 -0
- data/app/controllers/spree/admin/variants_controller.rb +2 -0
- data/app/controllers/spree/admin/variants_including_master_controller.rb +2 -0
- data/app/controllers/spree/admin/zones_controller.rb +2 -0
- data/app/helpers/spree/admin/adjustments_helper.rb +2 -0
- data/app/helpers/spree/admin/base_helper.rb +6 -3
- data/app/helpers/spree/admin/customer_returns_helper.rb +2 -0
- data/app/helpers/spree/admin/navigation_helper.rb +11 -7
- data/app/helpers/spree/admin/orders_helper.rb +5 -3
- data/app/helpers/spree/admin/payments_helper.rb +4 -3
- data/app/helpers/spree/admin/products_helper.rb +2 -0
- data/app/helpers/spree/admin/reimbursement_type_helper.rb +2 -0
- data/app/helpers/spree/admin/stock_locations_helper.rb +2 -0
- data/app/helpers/spree/admin/stock_movements_helper.rb +2 -0
- data/app/helpers/spree/admin/store_credit_events_helper.rb +2 -0
- data/app/helpers/spree/promotion_rules_helper.rb +2 -0
- data/app/models/spree/backend_configuration.rb +2 -0
- data/app/views/spree/admin/adjustment_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/adjustments/edit.html.erb +1 -1
- data/app/views/spree/admin/adjustments/index.html.erb +2 -2
- data/app/views/spree/admin/adjustments/new.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/index.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/new.html.erb +2 -2
- data/app/views/spree/admin/images/_image_row.html.erb +1 -1
- data/app/views/spree/admin/images/_new.html.erb +1 -1
- data/app/views/spree/admin/images/edit.html.erb +2 -2
- data/app/views/spree/admin/log_entries/index.html.erb +2 -2
- data/app/views/spree/admin/option_types/index.html.erb +1 -1
- data/app/views/spree/admin/orders/_carton_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/cart.html.erb +2 -2
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/show.html.erb +1 -1
- data/app/views/spree/admin/orders/edit.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +2 -2
- data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/index.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
- data/app/views/spree/admin/payments/_list.html.erb +2 -2
- data/app/views/spree/admin/payments/credit.html.erb +1 -1
- data/app/views/spree/admin/payments/index.html.erb +1 -1
- data/app/views/spree/admin/payments/new.html.erb +1 -1
- data/app/views/spree/admin/payments/show.html.erb +2 -2
- data/app/views/spree/admin/prices/_form.html.erb +1 -1
- data/app/views/spree/admin/prices/index.html.erb +2 -2
- data/app/views/spree/admin/product_properties/index.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +4 -1
- data/app/views/spree/admin/products/edit.html.erb +1 -1
- data/app/views/spree/admin/products/index.html.erb +2 -2
- data/app/views/spree/admin/promotion_categories/_form.html.erb +1 -1
- data/app/views/spree/admin/promotion_categories/index.html.erb +37 -29
- data/app/views/spree/admin/promotion_code_batches/download.csv.ruby +2 -0
- data/app/views/spree/admin/promotion_code_batches/index.html.erb +1 -1
- data/app/views/spree/admin/promotion_code_batches/new.html.erb +6 -1
- data/app/views/spree/admin/promotion_codes/index.csv.ruby +2 -0
- data/app/views/spree/admin/promotion_codes/index.html.erb +1 -1
- data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
- data/app/views/spree/admin/promotions/_activations_new.html.erb +4 -0
- data/app/views/spree/admin/promotions/_rules.html.erb +2 -2
- data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +5 -2
- data/app/views/spree/admin/promotions/edit.html.erb +2 -2
- data/app/views/spree/admin/promotions/index.html.erb +2 -2
- data/app/views/spree/admin/promotions/rules/_store.html.erb +6 -0
- data/app/views/spree/admin/properties/index.html.erb +2 -2
- data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/refunds/edit.html.erb +2 -2
- data/app/views/spree/admin/refunds/new.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/index.html.erb +1 -1
- data/app/views/spree/admin/reimbursements/show.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/edit.html.erb +3 -3
- data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/new.html.erb +2 -2
- data/app/views/spree/admin/search/products.json.jbuilder +2 -0
- data/app/views/spree/admin/search/users.json.jbuilder +2 -0
- data/app/views/spree/admin/shared/_datepicker.html.erb +8 -0
- data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_locale_selection.html.erb +15 -0
- data/app/views/spree/admin/shared/_navigation.html.erb +1 -0
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
- data/app/views/spree/admin/shared/_no_objects_found.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
- data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +1 -1
- data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
- data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -0
- data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/edit.html.erb +7 -0
- data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
- data/app/views/spree/admin/stock_movements/index.html.erb +15 -15
- data/app/views/spree/admin/store_credits/edit_validity.html.erb +2 -2
- data/app/views/spree/admin/store_credits/show.html.erb +2 -0
- data/app/views/spree/admin/stores/_form.html.erb +77 -60
- data/app/views/spree/admin/stores/edit.html.erb +1 -1
- data/app/views/spree/admin/stores/index.html.erb +3 -3
- data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/{edit.erb → edit.html.erb} +3 -3
- data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
- data/app/views/spree/admin/taxons/edit.html.erb +3 -3
- data/app/views/spree/admin/taxons/search.json.jbuilder +2 -0
- data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -1
- data/app/views/spree/admin/users/edit.html.erb +3 -3
- data/app/views/spree/admin/users/index.html.erb +2 -2
- data/app/views/spree/admin/zones/index.html.erb +1 -1
- data/config/initializers/assets.rb +2 -0
- data/config/initializers/form_builder.rb +2 -0
- data/config/routes.rb +4 -0
- data/lib/solidus_backend.rb +2 -0
- data/lib/spree/backend.rb +2 -0
- data/lib/spree/backend/action_callbacks.rb +2 -0
- data/lib/spree/backend/callbacks.rb +2 -0
- data/lib/spree/backend/engine.rb +2 -0
- data/lib/spree_backend.rb +2 -0
- data/script/rails +4 -2
- data/solidus_backend.gemspec +6 -5
- data/spec/controllers/spree/admin/base_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/cancellations_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +2 -1
- data/spec/controllers/spree/admin/orders_controller_spec.rb +2 -9
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/product_properties_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/products_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +27 -12
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/refunds_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/reports_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/resource_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/return_items_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/root_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/search_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/stock_items_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/store_credits_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/users_controller_spec.rb +2 -1
- data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -0
- data/spec/features/admin/configuration/payment_methods_spec.rb +2 -0
- data/spec/features/admin/configuration/shipping_methods_spec.rb +2 -0
- data/spec/features/admin/configuration/stock_locations_spec.rb +2 -0
- data/spec/features/admin/configuration/store_spec.rb +2 -0
- data/spec/features/admin/configuration/tax_categories_spec.rb +2 -0
- data/spec/features/admin/configuration/tax_rates_spec.rb +2 -0
- data/spec/features/admin/configuration/taxonomies_spec.rb +2 -0
- data/spec/features/admin/configuration/zones_spec.rb +2 -0
- data/spec/features/admin/homepage_spec.rb +2 -0
- data/spec/features/admin/javascript_format_money_spec.rb +2 -0
- data/spec/features/admin/locale_spec.rb +3 -0
- data/spec/features/admin/orders/adjustments_promotions_spec.rb +2 -0
- data/spec/features/admin/orders/adjustments_spec.rb +2 -0
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +2 -0
- data/spec/features/admin/orders/cancelling_inventory_spec.rb +2 -0
- data/spec/features/admin/orders/customer_details_spec.rb +3 -1
- data/spec/features/admin/orders/line_items_spec.rb +2 -0
- data/spec/features/admin/orders/listing_spec.rb +2 -0
- data/spec/features/admin/orders/log_entries_spec.rb +2 -0
- data/spec/features/admin/orders/new_order_spec.rb +3 -1
- data/spec/features/admin/orders/order_details_spec.rb +3 -2
- data/spec/features/admin/orders/payments_spec.rb +5 -6
- data/spec/features/admin/orders/return_authorizations_spec.rb +2 -0
- data/spec/features/admin/orders/return_payment_state_spec.rb +2 -0
- data/spec/features/admin/orders/risk_analysis_spec.rb +2 -0
- data/spec/features/admin/orders/shipments_spec.rb +2 -0
- data/spec/features/admin/payments/store_credits_spec.rb +2 -0
- data/spec/features/admin/products/edit/images_spec.rb +2 -0
- data/spec/features/admin/products/edit/products_spec.rb +2 -1
- data/spec/features/admin/products/edit/taxons_spec.rb +3 -1
- data/spec/features/admin/products/edit/variants_spec.rb +2 -0
- data/spec/features/admin/products/option_types_spec.rb +2 -0
- data/spec/features/admin/products/pricing_spec.rb +2 -0
- data/spec/features/admin/products/products_spec.rb +2 -1
- data/spec/features/admin/products/properties_spec.rb +2 -0
- data/spec/features/admin/products/stock_management_spec.rb +2 -0
- data/spec/features/admin/products/variant_spec.rb +2 -1
- data/spec/features/admin/promotion_adjustments_spec.rb +2 -0
- data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -0
- data/spec/features/admin/promotions/product_rule_spec.rb +2 -0
- data/spec/features/admin/promotions/promotion_categories_spec.rb +83 -0
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +3 -1
- data/spec/features/admin/promotions/user_rule_spec.rb +2 -0
- data/spec/features/admin/reimbursements_spec.rb +2 -0
- data/spec/features/admin/reports_spec.rb +2 -0
- data/spec/features/admin/store_credits_spec.rb +2 -0
- data/spec/features/admin/stores_spec.rb +2 -0
- data/spec/features/admin/style_guide_spec.rb +2 -0
- data/spec/features/admin/taxons_spec.rb +2 -0
- data/spec/features/admin/users_spec.rb +2 -0
- data/spec/helpers/admin/base_helper_spec.rb +2 -0
- data/spec/helpers/admin/navigation_helper_spec.rb +2 -1
- data/spec/helpers/admin/stock_movements_helper_spec.rb +2 -0
- data/spec/helpers/admin/store_credit_events_helper_spec.rb +2 -0
- data/spec/helpers/promotion_rules_helper_spec.rb +2 -0
- data/spec/spec_helper.rb +3 -1
- data/spec/support/appear_before_matcher.rb +2 -0
- data/spec/support/feature/base_feature_helper.rb +2 -0
- data/spec/support/feature/order_feature_helper.rb +2 -0
- data/spec/teaspoon_env.rb +3 -1
- data/spec/views/spree/admin/shared/navigation_footer_spec.rb +2 -1
- metadata +43 -35
data/lib/spree/backend/engine.rb
CHANGED
data/lib/spree_backend.rb
CHANGED
data/script/rails
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
5
|
|
4
|
-
ENGINE_ROOT = File.expand_path('
|
5
|
-
ENGINE_PATH = File.expand_path('
|
6
|
+
ENGINE_ROOT = File.expand_path('..', __dir__)
|
7
|
+
ENGINE_PATH = File.expand_path('../lib/spree/backend/engine', __dir__)
|
6
8
|
|
7
9
|
require 'rails/all'
|
8
10
|
require 'rails/engine/commands'
|
data/solidus_backend.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require_relative '../core/lib/spree/core/version.rb'
|
3
4
|
|
4
5
|
Gem::Specification.new do |s|
|
@@ -23,13 +24,13 @@ Gem::Specification.new do |s|
|
|
23
24
|
s.add_dependency 'solidus_api', s.version
|
24
25
|
s.add_dependency 'solidus_core', s.version
|
25
26
|
|
26
|
-
s.add_dependency 'sass-rails'
|
27
27
|
s.add_dependency 'coffee-rails'
|
28
|
-
s.add_dependency 'jquery-rails'
|
29
28
|
s.add_dependency 'font-awesome-rails', '~> 4.0'
|
30
|
-
s.add_dependency 'kaminari', '~> 1.1'
|
31
29
|
s.add_dependency 'jbuilder', '~> 2.6'
|
30
|
+
s.add_dependency 'jquery-rails'
|
31
|
+
s.add_dependency 'kaminari', '~> 1.1'
|
32
|
+
s.add_dependency 'sass-rails'
|
32
33
|
|
33
|
-
s.add_dependency 'handlebars_assets', '~> 0.23'
|
34
34
|
s.add_dependency 'autoprefixer-rails', '~> 7.1'
|
35
|
+
s.add_dependency 'handlebars_assets', '~> 0.23'
|
35
36
|
end
|
@@ -1,6 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'cancan'
|
3
|
-
require 'spree/testing_support/bar_ability'
|
4
5
|
|
5
6
|
describe Spree::Admin::OrdersController, type: :controller do
|
6
7
|
let!(:store) { create(:store) }
|
@@ -357,14 +358,6 @@ describe Spree::Admin::OrdersController, type: :controller do
|
|
357
358
|
expect(response).to render_template :index
|
358
359
|
end
|
359
360
|
|
360
|
-
it 'should grant access to users with an bar role' do
|
361
|
-
user.spree_roles << Spree::Role.find_or_create_by(name: 'bar')
|
362
|
-
Spree::Ability.register_ability(BarAbility)
|
363
|
-
get :index
|
364
|
-
expect(response).to render_template :index
|
365
|
-
Spree::Ability.remove_ability(BarAbility)
|
366
|
-
end
|
367
|
-
|
368
361
|
it 'should deny access to users without an admin role' do
|
369
362
|
allow(user).to receive_messages has_spree_role?: false
|
370
363
|
get :index
|
@@ -1,21 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe Spree::Admin::PromotionRulesController, type: :controller do
|
4
|
-
stub_authorization!
|
5
|
-
|
6
6
|
let!(:promotion) { create(:promotion) }
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
context "when the user is authorized" do
|
9
|
+
stub_authorization! do |_u|
|
10
|
+
Spree::PermissionSets::PromotionManagement.new(self).activate!
|
11
|
+
end
|
12
|
+
|
13
|
+
it "can create a promotion rule of a valid type" do
|
14
|
+
post :create, params: { promotion_id: promotion.id, promotion_rule: { type: "Spree::Promotion::Rules::Product" } }
|
15
|
+
expect(response).to be_redirect
|
16
|
+
expect(response).to redirect_to spree.edit_admin_promotion_path(promotion)
|
17
|
+
expect(promotion.rules.count).to eq(1)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "can not create a promotion rule of an invalid type" do
|
21
|
+
post :create, params: { promotion_id: promotion.id, promotion_rule: { type: "Spree::InvalidType" } }
|
22
|
+
expect(response).to be_redirect
|
23
|
+
expect(response).to redirect_to spree.edit_admin_promotion_path(promotion)
|
24
|
+
expect(promotion.rules.count).to eq(0)
|
25
|
+
end
|
13
26
|
end
|
14
27
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
28
|
+
context "when the user is not authorized" do
|
29
|
+
it "sets an error message and redirects the user" do
|
30
|
+
post :create, params: { promotion_id: promotion.id, promotion_rule: { type: "Spree::Promotion::Rules::Product" } }
|
31
|
+
|
32
|
+
expect(flash[:error]).to eq("Authorization Failure")
|
33
|
+
expect(response).to redirect_to('/unauthorized')
|
34
|
+
end
|
20
35
|
end
|
21
36
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe "setting locale", type: :feature do
|
@@ -11,6 +13,7 @@ describe "setting locale", type: :feature do
|
|
11
13
|
month_names: []
|
12
14
|
},
|
13
15
|
spree: {
|
16
|
+
i18n: { this_file_language: "Français" },
|
14
17
|
admin: {
|
15
18
|
tab: { orders: "Ordres" }
|
16
19
|
},
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
|
3
5
|
describe "Customer Details", type: :feature, js: true do
|
@@ -199,6 +201,6 @@ describe "Customer Details", type: :feature, js: true do
|
|
199
201
|
fill_in "City", with: "Bethesda"
|
200
202
|
fill_in "Zip Code", with: "20170"
|
201
203
|
select 'Alabama', from: "State"
|
202
|
-
fill_in "Phone",
|
204
|
+
fill_in "Phone", with: "123-456-7890"
|
203
205
|
end
|
204
206
|
end
|