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.

Files changed (274) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +5 -3
  3. data/app/assets/javascripts/spree/backend.js +1 -0
  4. data/app/assets/javascripts/spree/backend/admin.js +1 -0
  5. data/app/assets/javascripts/spree/backend/highlight_negative_numbers.js +14 -0
  6. data/app/assets/javascripts/spree/backend/locale_selection.js +18 -0
  7. data/app/assets/javascripts/spree/backend/templates/products/sortable.hbs +1 -1
  8. data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +11 -2
  9. data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +3 -1
  10. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +6 -2
  11. data/app/assets/stylesheets/spree/backend/globals/_functions.scss +1 -2
  12. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +3 -0
  13. data/app/controllers/spree/admin/adjustment_reasons_controller.rb +2 -0
  14. data/app/controllers/spree/admin/adjustments_controller.rb +2 -0
  15. data/app/controllers/spree/admin/base_controller.rb +2 -0
  16. data/app/controllers/spree/admin/cancellations_controller.rb +2 -0
  17. data/app/controllers/spree/admin/customer_returns_controller.rb +2 -0
  18. data/app/controllers/spree/admin/dashboards_controller.rb +2 -0
  19. data/app/controllers/spree/admin/general_settings_controller.rb +2 -0
  20. data/app/controllers/spree/admin/images_controller.rb +2 -0
  21. data/app/controllers/spree/admin/locale_controller.rb +24 -0
  22. data/app/controllers/spree/admin/log_entries_controller.rb +2 -0
  23. data/app/controllers/spree/admin/option_types_controller.rb +2 -0
  24. data/app/controllers/spree/admin/option_values_controller.rb +2 -0
  25. data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -0
  26. data/app/controllers/spree/admin/orders_controller.rb +4 -2
  27. data/app/controllers/spree/admin/payment_methods_controller.rb +2 -0
  28. data/app/controllers/spree/admin/payments_controller.rb +2 -0
  29. data/app/controllers/spree/admin/prices_controller.rb +2 -0
  30. data/app/controllers/spree/admin/product_properties_controller.rb +2 -0
  31. data/app/controllers/spree/admin/products_controller.rb +2 -0
  32. data/app/controllers/spree/admin/promotion_actions_controller.rb +2 -0
  33. data/app/controllers/spree/admin/promotion_categories_controller.rb +2 -0
  34. data/app/controllers/spree/admin/promotion_code_batches_controller.rb +2 -0
  35. data/app/controllers/spree/admin/promotion_codes_controller.rb +2 -0
  36. data/app/controllers/spree/admin/promotion_rules_controller.rb +6 -0
  37. data/app/controllers/spree/admin/promotions_controller.rb +2 -0
  38. data/app/controllers/spree/admin/properties_controller.rb +2 -0
  39. data/app/controllers/spree/admin/refund_reasons_controller.rb +2 -0
  40. data/app/controllers/spree/admin/refunds_controller.rb +2 -0
  41. data/app/controllers/spree/admin/reimbursement_types_controller.rb +2 -0
  42. data/app/controllers/spree/admin/reimbursements_controller.rb +2 -0
  43. data/app/controllers/spree/admin/reports_controller.rb +2 -0
  44. data/app/controllers/spree/admin/resource_controller.rb +2 -0
  45. data/app/controllers/spree/admin/return_authorizations_controller.rb +2 -0
  46. data/app/controllers/spree/admin/return_items_controller.rb +2 -0
  47. data/app/controllers/spree/admin/return_reasons_controller.rb +2 -0
  48. data/app/controllers/spree/admin/root_controller.rb +2 -0
  49. data/app/controllers/spree/admin/search_controller.rb +2 -0
  50. data/app/controllers/spree/admin/shipping_categories_controller.rb +2 -0
  51. data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -0
  52. data/app/controllers/spree/admin/stock_items_controller.rb +2 -0
  53. data/app/controllers/spree/admin/stock_locations_controller.rb +2 -1
  54. data/app/controllers/spree/admin/stock_movements_controller.rb +2 -0
  55. data/app/controllers/spree/admin/store_credits_controller.rb +2 -0
  56. data/app/controllers/spree/admin/stores_controller.rb +2 -0
  57. data/app/controllers/spree/admin/style_guide_controller.rb +2 -0
  58. data/app/controllers/spree/admin/tax_categories_controller.rb +2 -0
  59. data/app/controllers/spree/admin/tax_rates_controller.rb +2 -0
  60. data/app/controllers/spree/admin/taxonomies_controller.rb +2 -0
  61. data/app/controllers/spree/admin/taxons_controller.rb +2 -0
  62. data/app/controllers/spree/admin/users_controller.rb +4 -1
  63. data/app/controllers/spree/admin/variant_property_rule_values_controller.rb +2 -0
  64. data/app/controllers/spree/admin/variants_controller.rb +2 -0
  65. data/app/controllers/spree/admin/variants_including_master_controller.rb +2 -0
  66. data/app/controllers/spree/admin/zones_controller.rb +2 -0
  67. data/app/helpers/spree/admin/adjustments_helper.rb +2 -0
  68. data/app/helpers/spree/admin/base_helper.rb +6 -3
  69. data/app/helpers/spree/admin/customer_returns_helper.rb +2 -0
  70. data/app/helpers/spree/admin/navigation_helper.rb +11 -7
  71. data/app/helpers/spree/admin/orders_helper.rb +5 -3
  72. data/app/helpers/spree/admin/payments_helper.rb +4 -3
  73. data/app/helpers/spree/admin/products_helper.rb +2 -0
  74. data/app/helpers/spree/admin/reimbursement_type_helper.rb +2 -0
  75. data/app/helpers/spree/admin/stock_locations_helper.rb +2 -0
  76. data/app/helpers/spree/admin/stock_movements_helper.rb +2 -0
  77. data/app/helpers/spree/admin/store_credit_events_helper.rb +2 -0
  78. data/app/helpers/spree/promotion_rules_helper.rb +2 -0
  79. data/app/models/spree/backend_configuration.rb +2 -0
  80. data/app/views/spree/admin/adjustment_reasons/index.html.erb +1 -1
  81. data/app/views/spree/admin/adjustments/edit.html.erb +1 -1
  82. data/app/views/spree/admin/adjustments/index.html.erb +2 -2
  83. data/app/views/spree/admin/adjustments/new.html.erb +2 -2
  84. data/app/views/spree/admin/customer_returns/index.html.erb +1 -1
  85. data/app/views/spree/admin/customer_returns/new.html.erb +2 -2
  86. data/app/views/spree/admin/images/_image_row.html.erb +1 -1
  87. data/app/views/spree/admin/images/_new.html.erb +1 -1
  88. data/app/views/spree/admin/images/edit.html.erb +2 -2
  89. data/app/views/spree/admin/log_entries/index.html.erb +2 -2
  90. data/app/views/spree/admin/option_types/index.html.erb +1 -1
  91. data/app/views/spree/admin/orders/_carton_manifest.html.erb +1 -1
  92. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
  93. data/app/views/spree/admin/orders/cart.html.erb +2 -2
  94. data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
  95. data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
  96. data/app/views/spree/admin/orders/customer_details/show.html.erb +1 -1
  97. data/app/views/spree/admin/orders/edit.html.erb +1 -1
  98. data/app/views/spree/admin/orders/index.html.erb +2 -2
  99. data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
  100. data/app/views/spree/admin/payment_methods/index.html.erb +1 -1
  101. data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
  102. data/app/views/spree/admin/payments/_list.html.erb +2 -2
  103. data/app/views/spree/admin/payments/credit.html.erb +1 -1
  104. data/app/views/spree/admin/payments/index.html.erb +1 -1
  105. data/app/views/spree/admin/payments/new.html.erb +1 -1
  106. data/app/views/spree/admin/payments/show.html.erb +2 -2
  107. data/app/views/spree/admin/prices/_form.html.erb +1 -1
  108. data/app/views/spree/admin/prices/index.html.erb +2 -2
  109. data/app/views/spree/admin/product_properties/index.html.erb +1 -1
  110. data/app/views/spree/admin/products/_form.html.erb +4 -1
  111. data/app/views/spree/admin/products/edit.html.erb +1 -1
  112. data/app/views/spree/admin/products/index.html.erb +2 -2
  113. data/app/views/spree/admin/promotion_categories/_form.html.erb +1 -1
  114. data/app/views/spree/admin/promotion_categories/index.html.erb +37 -29
  115. data/app/views/spree/admin/promotion_code_batches/download.csv.ruby +2 -0
  116. data/app/views/spree/admin/promotion_code_batches/index.html.erb +1 -1
  117. data/app/views/spree/admin/promotion_code_batches/new.html.erb +6 -1
  118. data/app/views/spree/admin/promotion_codes/index.csv.ruby +2 -0
  119. data/app/views/spree/admin/promotion_codes/index.html.erb +1 -1
  120. data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
  121. data/app/views/spree/admin/promotions/_activations_new.html.erb +4 -0
  122. data/app/views/spree/admin/promotions/_rules.html.erb +2 -2
  123. data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +5 -2
  124. data/app/views/spree/admin/promotions/edit.html.erb +2 -2
  125. data/app/views/spree/admin/promotions/index.html.erb +2 -2
  126. data/app/views/spree/admin/promotions/rules/_store.html.erb +6 -0
  127. data/app/views/spree/admin/properties/index.html.erb +2 -2
  128. data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
  129. data/app/views/spree/admin/refunds/edit.html.erb +2 -2
  130. data/app/views/spree/admin/refunds/new.html.erb +2 -2
  131. data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
  132. data/app/views/spree/admin/reimbursements/index.html.erb +1 -1
  133. data/app/views/spree/admin/reimbursements/show.html.erb +1 -1
  134. data/app/views/spree/admin/return_authorizations/edit.html.erb +3 -3
  135. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  136. data/app/views/spree/admin/return_authorizations/new.html.erb +2 -2
  137. data/app/views/spree/admin/search/products.json.jbuilder +2 -0
  138. data/app/views/spree/admin/search/users.json.jbuilder +2 -0
  139. data/app/views/spree/admin/shared/_datepicker.html.erb +8 -0
  140. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
  141. data/app/views/spree/admin/shared/_locale_selection.html.erb +15 -0
  142. data/app/views/spree/admin/shared/_navigation.html.erb +1 -0
  143. data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
  144. data/app/views/spree/admin/shared/_no_objects_found.html.erb +1 -1
  145. data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
  146. data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
  147. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +1 -1
  148. data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
  149. data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
  150. data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
  151. data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -0
  152. data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
  153. data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
  154. data/app/views/spree/admin/stock_locations/edit.html.erb +7 -0
  155. data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
  156. data/app/views/spree/admin/stock_movements/index.html.erb +15 -15
  157. data/app/views/spree/admin/store_credits/edit_validity.html.erb +2 -2
  158. data/app/views/spree/admin/store_credits/show.html.erb +2 -0
  159. data/app/views/spree/admin/stores/_form.html.erb +77 -60
  160. data/app/views/spree/admin/stores/edit.html.erb +1 -1
  161. data/app/views/spree/admin/stores/index.html.erb +3 -3
  162. data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
  163. data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
  164. data/app/views/spree/admin/taxonomies/{edit.erb → edit.html.erb} +3 -3
  165. data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
  166. data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
  167. data/app/views/spree/admin/taxons/edit.html.erb +3 -3
  168. data/app/views/spree/admin/taxons/search.json.jbuilder +2 -0
  169. data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -1
  170. data/app/views/spree/admin/users/edit.html.erb +3 -3
  171. data/app/views/spree/admin/users/index.html.erb +2 -2
  172. data/app/views/spree/admin/zones/index.html.erb +1 -1
  173. data/config/initializers/assets.rb +2 -0
  174. data/config/initializers/form_builder.rb +2 -0
  175. data/config/routes.rb +4 -0
  176. data/lib/solidus_backend.rb +2 -0
  177. data/lib/spree/backend.rb +2 -0
  178. data/lib/spree/backend/action_callbacks.rb +2 -0
  179. data/lib/spree/backend/callbacks.rb +2 -0
  180. data/lib/spree/backend/engine.rb +2 -0
  181. data/lib/spree_backend.rb +2 -0
  182. data/script/rails +4 -2
  183. data/solidus_backend.gemspec +6 -5
  184. data/spec/controllers/spree/admin/base_controller_spec.rb +2 -0
  185. data/spec/controllers/spree/admin/cancellations_controller_spec.rb +2 -0
  186. data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +2 -0
  187. data/spec/controllers/spree/admin/missing_products_controller_spec.rb +2 -0
  188. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +2 -1
  189. data/spec/controllers/spree/admin/orders_controller_spec.rb +2 -9
  190. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -0
  191. data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -0
  192. data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -0
  193. data/spec/controllers/spree/admin/product_properties_controller_spec.rb +2 -0
  194. data/spec/controllers/spree/admin/products_controller_spec.rb +2 -0
  195. data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -0
  196. data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +2 -0
  197. data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +27 -12
  198. data/spec/controllers/spree/admin/promotions_controller_spec.rb +2 -0
  199. data/spec/controllers/spree/admin/refunds_controller_spec.rb +2 -0
  200. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +2 -0
  201. data/spec/controllers/spree/admin/reports_controller_spec.rb +2 -0
  202. data/spec/controllers/spree/admin/resource_controller_spec.rb +2 -0
  203. data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +2 -0
  204. data/spec/controllers/spree/admin/return_items_controller_spec.rb +2 -0
  205. data/spec/controllers/spree/admin/root_controller_spec.rb +2 -0
  206. data/spec/controllers/spree/admin/search_controller_spec.rb +2 -0
  207. data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +2 -0
  208. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +2 -0
  209. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +2 -0
  210. data/spec/controllers/spree/admin/store_credits_controller_spec.rb +2 -0
  211. data/spec/controllers/spree/admin/users_controller_spec.rb +2 -1
  212. data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -0
  213. data/spec/features/admin/configuration/payment_methods_spec.rb +2 -0
  214. data/spec/features/admin/configuration/shipping_methods_spec.rb +2 -0
  215. data/spec/features/admin/configuration/stock_locations_spec.rb +2 -0
  216. data/spec/features/admin/configuration/store_spec.rb +2 -0
  217. data/spec/features/admin/configuration/tax_categories_spec.rb +2 -0
  218. data/spec/features/admin/configuration/tax_rates_spec.rb +2 -0
  219. data/spec/features/admin/configuration/taxonomies_spec.rb +2 -0
  220. data/spec/features/admin/configuration/zones_spec.rb +2 -0
  221. data/spec/features/admin/homepage_spec.rb +2 -0
  222. data/spec/features/admin/javascript_format_money_spec.rb +2 -0
  223. data/spec/features/admin/locale_spec.rb +3 -0
  224. data/spec/features/admin/orders/adjustments_promotions_spec.rb +2 -0
  225. data/spec/features/admin/orders/adjustments_spec.rb +2 -0
  226. data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +2 -0
  227. data/spec/features/admin/orders/cancelling_inventory_spec.rb +2 -0
  228. data/spec/features/admin/orders/customer_details_spec.rb +3 -1
  229. data/spec/features/admin/orders/line_items_spec.rb +2 -0
  230. data/spec/features/admin/orders/listing_spec.rb +2 -0
  231. data/spec/features/admin/orders/log_entries_spec.rb +2 -0
  232. data/spec/features/admin/orders/new_order_spec.rb +3 -1
  233. data/spec/features/admin/orders/order_details_spec.rb +3 -2
  234. data/spec/features/admin/orders/payments_spec.rb +5 -6
  235. data/spec/features/admin/orders/return_authorizations_spec.rb +2 -0
  236. data/spec/features/admin/orders/return_payment_state_spec.rb +2 -0
  237. data/spec/features/admin/orders/risk_analysis_spec.rb +2 -0
  238. data/spec/features/admin/orders/shipments_spec.rb +2 -0
  239. data/spec/features/admin/payments/store_credits_spec.rb +2 -0
  240. data/spec/features/admin/products/edit/images_spec.rb +2 -0
  241. data/spec/features/admin/products/edit/products_spec.rb +2 -1
  242. data/spec/features/admin/products/edit/taxons_spec.rb +3 -1
  243. data/spec/features/admin/products/edit/variants_spec.rb +2 -0
  244. data/spec/features/admin/products/option_types_spec.rb +2 -0
  245. data/spec/features/admin/products/pricing_spec.rb +2 -0
  246. data/spec/features/admin/products/products_spec.rb +2 -1
  247. data/spec/features/admin/products/properties_spec.rb +2 -0
  248. data/spec/features/admin/products/stock_management_spec.rb +2 -0
  249. data/spec/features/admin/products/variant_spec.rb +2 -1
  250. data/spec/features/admin/promotion_adjustments_spec.rb +2 -0
  251. data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -0
  252. data/spec/features/admin/promotions/product_rule_spec.rb +2 -0
  253. data/spec/features/admin/promotions/promotion_categories_spec.rb +83 -0
  254. data/spec/features/admin/promotions/tiered_calculator_spec.rb +3 -1
  255. data/spec/features/admin/promotions/user_rule_spec.rb +2 -0
  256. data/spec/features/admin/reimbursements_spec.rb +2 -0
  257. data/spec/features/admin/reports_spec.rb +2 -0
  258. data/spec/features/admin/store_credits_spec.rb +2 -0
  259. data/spec/features/admin/stores_spec.rb +2 -0
  260. data/spec/features/admin/style_guide_spec.rb +2 -0
  261. data/spec/features/admin/taxons_spec.rb +2 -0
  262. data/spec/features/admin/users_spec.rb +2 -0
  263. data/spec/helpers/admin/base_helper_spec.rb +2 -0
  264. data/spec/helpers/admin/navigation_helper_spec.rb +2 -1
  265. data/spec/helpers/admin/stock_movements_helper_spec.rb +2 -0
  266. data/spec/helpers/admin/store_credit_events_helper_spec.rb +2 -0
  267. data/spec/helpers/promotion_rules_helper_spec.rb +2 -0
  268. data/spec/spec_helper.rb +3 -1
  269. data/spec/support/appear_before_matcher.rb +2 -0
  270. data/spec/support/feature/base_feature_helper.rb +2 -0
  271. data/spec/support/feature/order_feature_helper.rb +2 -0
  272. data/spec/teaspoon_env.rb +3 -1
  273. data/spec/views/spree/admin/shared/navigation_footer_spec.rb +2 -1
  274. metadata +43 -35
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  # Tests for https://github.com/spree/spree/issues/3958's features
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Orders Listing", type: :feature, js: true do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Log entries", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "New Order", type: :feature do
@@ -207,6 +209,6 @@ describe "New Order", type: :feature do
207
209
  fill_in "City", with: "Bethesda"
208
210
  fill_in "Zip Code", with: "20170"
209
211
  select state.name, from: "State"
210
- fill_in "Phone", with: "123-456-7890"
212
+ fill_in "Phone", with: "123-456-7890"
211
213
  end
212
214
  end
@@ -1,4 +1,5 @@
1
- # coding: utf-8
1
+ # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  describe "Order Details", type: :feature, js: true do
@@ -479,7 +480,7 @@ describe "Order Details", type: :feature, js: true do
479
480
 
480
481
  @first_line_item = order.contents.add(product2.master)
481
482
  @first_line_item.update_columns(created_at: 1.day.ago)
482
- @last_line_item = order.contents.add(product3.master)
483
+ @last_line_item = order.contents.add(product3.master)
483
484
  @last_line_item.update_columns(created_at: 1.day.from_now)
484
485
  end
485
486
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Payments', type: :feature do
@@ -9,8 +11,7 @@ describe 'Payments', type: :feature do
9
11
  order: order,
10
12
  amount: order.outstanding_balance,
11
13
  payment_method: create(:credit_card_payment_method),
12
- state: state
13
- )
14
+ state: state)
14
15
  end
15
16
 
16
17
  let(:order) { create(:completed_order_with_totals, number: 'R100', line_items_price: 50) }
@@ -27,8 +28,7 @@ describe 'Payments', type: :feature do
27
28
  create(:payment,
28
29
  order: order,
29
30
  amount: order.outstanding_balance,
30
- payment_method: create(:check_payment_method, available_to_admin: true) # Check
31
- )
31
+ payment_method: create(:check_payment_method, available_to_admin: true)) # Check
32
32
  end
33
33
 
34
34
  it 'capturing a check payment from a new order' do
@@ -220,8 +220,7 @@ describe 'Payments', type: :feature do
220
220
  create(:payment,
221
221
  order: order,
222
222
  amount: order.outstanding_balance,
223
- payment_method: payment_method
224
- )
223
+ payment_method: payment_method)
225
224
  end
226
225
 
227
226
  before do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "ReturnAuthorizations", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Return payment state spec" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Order Risk Analysis', type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Shipments", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe 'Store credits', type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Product Images", type: :feature do
@@ -1,4 +1,5 @@
1
- # encoding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  describe 'Product Details', type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Product Display Order", type: :feature do
@@ -30,7 +32,7 @@ describe "Product Display Order", type: :feature do
30
32
  assert_selected_taxons([taxon_1, taxon_2])
31
33
  end
32
34
 
33
- context "with an XSS attempt" do
35
+ context "with an XSS attempt", skip: true do
34
36
  let(:taxon_name) { %(<script>throw("XSS")</script>) }
35
37
  let!(:taxon) { create(:taxon, name: taxon_name) }
36
38
  it "displays the escaped HTML without executing it" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Product Variants", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Option Types", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Pricing' do
@@ -1,4 +1,5 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  describe "Products", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Properties", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Product Stock", type: :feature do
@@ -1,4 +1,5 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  describe "Variants", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Promotion Adjustments", type: :feature, js: true do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  feature 'Promotion with option value rule' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  feature 'Promotion with product rule', js: true do
@@ -0,0 +1,83 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Promotion Categories', type: :feature do
4
+ stub_authorization!
5
+
6
+ context "index" do
7
+ before do
8
+ create(:promotion_category, name: 'name1', code: 'code1')
9
+ create(:promotion_category, name: 'name2', code: 'code2')
10
+ visit spree.admin_promotion_categories_path
11
+ end
12
+
13
+ context "listing promotion categories" do
14
+ it "should list the existing promotion categories" do
15
+ within_row(1) do
16
+ expect(column_text(1)).to eq("name1")
17
+ expect(column_text(2)).to eq("code1")
18
+ end
19
+
20
+ within_row(2) do
21
+ expect(column_text(1)).to eq("name2")
22
+ expect(column_text(2)).to eq("code2")
23
+ end
24
+ end
25
+ end
26
+ end
27
+
28
+ context "create" do
29
+ before do
30
+ visit spree.admin_promotion_categories_path
31
+ click_on "New Promotion Category"
32
+ end
33
+
34
+ it "should allow an admin to create a new promotion category" do
35
+ fill_in "promotion_category_name", with: "promotion test"
36
+ fill_in "promotion_category_code", with: "prtest"
37
+ click_button "Create"
38
+ expect(page).to have_content("successfully created!")
39
+ end
40
+
41
+ it "should not allow admin to create promotion category when invalid data" do
42
+ fill_in "promotion_category_name", with: ""
43
+ fill_in "promotion_category_code", with: "prtest"
44
+ click_button "Create"
45
+ expect(page).to have_content("Name can't be blank")
46
+ end
47
+ end
48
+
49
+ context "edit" do
50
+ before(:each) do
51
+ create(:promotion_category, name: 'name1')
52
+ visit spree.admin_promotion_categories_path
53
+ within_row(1) { click_icon :edit }
54
+ end
55
+
56
+ it "should allow an admin to edit an existing promotion category" do
57
+ fill_in "promotion_category_name", with: "name 99"
58
+ click_button "Update"
59
+ expect(page).to have_content("successfully updated!")
60
+ expect(page).to have_content("name 99")
61
+ end
62
+
63
+ it "should show validation errors" do
64
+ fill_in "promotion_category_name", with: ""
65
+ click_button "Update"
66
+ expect(page).to have_content("Name can't be blank")
67
+ end
68
+ end
69
+
70
+ context "delete" do
71
+ before(:each) do
72
+ create(:promotion_category, name: 'name1')
73
+ visit spree.admin_promotion_categories_path
74
+ end
75
+
76
+ it "should allow an admin to delete an existing promotion category", js: true do
77
+ accept_alert do
78
+ click_icon :trash
79
+ end
80
+ expect(page).to have_content("successfully removed!")
81
+ end
82
+ end
83
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  feature "Tiered Calculator Promotions" do
@@ -49,7 +51,7 @@ feature "Tiered Calculator Promotions" do
49
51
 
50
52
  action.calculator = Spree::Calculator::TieredFlatRate.new
51
53
  action.calculator.preferred_base_amount = 5
52
- action.calculator.preferred_tiers = {100 => 10, 200 => 15, 300 => 20}
54
+ action.calculator.preferred_tiers = { 100 => 10, 200 => 15, 300 => 20 }
53
55
  action.calculator.save!
54
56
 
55
57
  visit spree.edit_admin_promotion_path(promotion)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  feature 'Promotion with user rule', js: true do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Promotions', type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Reports", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Store credits admin" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Stores', type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Style guide", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe "Taxonomies and taxons", type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'Users', type: :feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Spree::Admin::BaseHelper, type: :helper do
@@ -1,4 +1,5 @@
1
- # coding: UTF-8
1
+ # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  describe Spree::Admin::NavigationHelper, type: :helper do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Spree::Admin::StockMovementsHelper, type: :helper do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Spree::Admin::StoreCreditEventsHelper, type: :helper do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  module Spree
3
5
  describe Spree::PromotionRulesHelper, type: :helper do
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  if ENV["COVERAGE"]
2
4
  require 'simplecov'
3
5
  SimpleCov.start('rails')
@@ -10,7 +12,7 @@ ENV["RAILS_ENV"] ||= 'test'
10
12
  require 'solidus_backend'
11
13
  require 'spree/testing_support/dummy_app'
12
14
  DummyApp.setup(
13
- gem_root: File.expand_path('../../', __FILE__),
15
+ gem_root: File.expand_path('..', __dir__),
14
16
  lib_name: 'solidus_backend'
15
17
  )
16
18
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rspec/expectations'
2
4
 
3
5
  RSpec::Matchers.define :appear_before do |expected|