solidus_backend 1.3.2 → 1.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

Files changed (290) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -0
  3. data/app/assets/javascripts/spree/backend/components/tooltips.js +2 -0
  4. data/app/assets/javascripts/spree/backend/product_picker.js +2 -2
  5. data/app/assets/javascripts/spree/backend/routes.js +0 -1
  6. data/app/assets/javascripts/spree/backend/shipments.js +147 -118
  7. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +16 -14
  8. data/app/assets/javascripts/spree/backend/templates/orders/customer_details/autocomplete.hbs +1 -1
  9. data/app/assets/javascripts/spree/backend/templates/variants/autocomplete.hbs.erb +1 -1
  10. data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs +1 -1
  11. data/app/assets/javascripts/spree/backend/templates/variants/split.hbs +25 -27
  12. data/app/assets/javascripts/spree/backend/user_picker.js +14 -8
  13. data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +3 -3
  14. data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +4 -0
  15. data/app/assets/stylesheets/spree/backend/components/_date-picker.scss +0 -1
  16. data/app/assets/stylesheets/spree/backend/components/_hint.scss +3 -0
  17. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +0 -1
  18. data/app/assets/stylesheets/spree/backend/components/_progress.scss +5 -2
  19. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +14 -5
  20. data/app/assets/stylesheets/spree/backend/components/_states.scss +1 -2
  21. data/app/assets/stylesheets/spree/backend/globals/_mixins.css +2 -0
  22. data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +22 -0
  23. data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +12 -3
  24. data/app/assets/stylesheets/spree/backend/sections/_products.scss +25 -7
  25. data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +0 -1
  26. data/app/assets/stylesheets/spree/backend/sections/_transfer_items.scss +0 -1
  27. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +4 -6
  28. data/app/assets/stylesheets/spree/backend/shared/_header.scss +5 -2
  29. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +36 -3
  30. data/app/assets/stylesheets/spree/backend/shared/_tables.scss +1 -3
  31. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +0 -2
  32. data/app/assets/stylesheets/spree/backend/spree_admin.scss +3 -1
  33. data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
  34. data/app/controllers/spree/admin/general_settings_controller.rb +0 -6
  35. data/app/controllers/spree/admin/orders/customer_details_controller.rb +7 -0
  36. data/app/controllers/spree/admin/orders_controller.rb +1 -1
  37. data/app/controllers/spree/admin/payment_methods_controller.rb +8 -3
  38. data/app/controllers/spree/admin/payments_controller.rb +12 -5
  39. data/app/controllers/spree/admin/products_controller.rb +1 -1
  40. data/app/controllers/spree/admin/refunds_controller.rb +1 -1
  41. data/app/controllers/spree/admin/reimbursements_controller.rb +1 -1
  42. data/app/controllers/spree/admin/root_controller.rb +1 -1
  43. data/app/controllers/spree/admin/stock_items_controller.rb +0 -8
  44. data/app/controllers/spree/admin/stock_transfers_controller.rb +6 -6
  45. data/app/controllers/spree/admin/users_controller.rb +7 -3
  46. data/app/helpers/spree/admin/base_helper.rb +11 -0
  47. data/app/helpers/spree/admin/navigation_helper.rb +46 -3
  48. data/app/helpers/spree/admin/orders_helper.rb +0 -1
  49. data/app/helpers/spree/admin/stock_locations_helper.rb +1 -5
  50. data/app/models/spree/backend_configuration.rb +100 -0
  51. data/app/views/spree/admin/adjustment_reasons/edit.html.erb +4 -7
  52. data/app/views/spree/admin/adjustment_reasons/index.html.erb +4 -4
  53. data/app/views/spree/admin/adjustment_reasons/new.html.erb +4 -4
  54. data/app/views/spree/admin/adjustments/edit.html.erb +4 -6
  55. data/app/views/spree/admin/adjustments/index.html.erb +3 -6
  56. data/app/views/spree/admin/adjustments/new.html.erb +5 -6
  57. data/app/views/spree/admin/cancellations/index.html.erb +4 -3
  58. data/app/views/spree/admin/countries/edit.html.erb +4 -6
  59. data/app/views/spree/admin/countries/index.html.erb +4 -4
  60. data/app/views/spree/admin/countries/new.html.erb +4 -4
  61. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +1 -1
  62. data/app/views/spree/admin/customer_returns/edit.html.erb +4 -6
  63. data/app/views/spree/admin/customer_returns/index.html.erb +2 -5
  64. data/app/views/spree/admin/customer_returns/new.html.erb +5 -6
  65. data/app/views/spree/admin/general_settings/edit.html.erb +4 -28
  66. data/app/views/spree/admin/images/edit.html.erb +6 -2
  67. data/app/views/spree/admin/images/index.html.erb +3 -0
  68. data/app/views/spree/admin/images/new.html.erb +3 -3
  69. data/app/views/spree/admin/log_entries/index.html.erb +4 -8
  70. data/app/views/spree/admin/option_types/edit.html.erb +7 -9
  71. data/app/views/spree/admin/option_types/index.html.erb +4 -4
  72. data/app/views/spree/admin/orders/_shipment.html.erb +4 -1
  73. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +4 -1
  74. data/app/views/spree/admin/orders/cart.html.erb +4 -8
  75. data/app/views/spree/admin/orders/confirm.html.erb +3 -4
  76. data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
  77. data/app/views/spree/admin/orders/confirm_advance.html.erb +3 -4
  78. data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
  79. data/app/views/spree/admin/orders/customer_details/edit.html.erb +2 -4
  80. data/app/views/spree/admin/orders/customer_details/show.html.erb +3 -5
  81. data/app/views/spree/admin/orders/edit.html.erb +1 -8
  82. data/app/views/spree/admin/orders/index.html.erb +11 -5
  83. data/app/views/spree/admin/payment_methods/edit.html.erb +5 -7
  84. data/app/views/spree/admin/payment_methods/index.html.erb +6 -5
  85. data/app/views/spree/admin/payment_methods/new.html.erb +6 -7
  86. data/app/views/spree/admin/payments/_capture_events.html.erb +1 -1
  87. data/app/views/spree/admin/payments/credit.html.erb +3 -3
  88. data/app/views/spree/admin/payments/index.html.erb +4 -7
  89. data/app/views/spree/admin/payments/new.html.erb +4 -5
  90. data/app/views/spree/admin/payments/show.html.erb +4 -7
  91. data/app/views/spree/admin/prices/_form.html.erb +1 -0
  92. data/app/views/spree/admin/prices/index.html.erb +2 -2
  93. data/app/views/spree/admin/product_properties/index.html.erb +3 -1
  94. data/app/views/spree/admin/products/_form.html.erb +11 -18
  95. data/app/views/spree/admin/products/_properties_form.erb +1 -1
  96. data/app/views/spree/admin/products/edit.html.erb +3 -2
  97. data/app/views/spree/admin/products/index.html.erb +19 -28
  98. data/app/views/spree/admin/products/new.html.erb +4 -2
  99. data/app/views/spree/admin/promotion_categories/edit.html.erb +4 -3
  100. data/app/views/spree/admin/promotion_categories/index.html.erb +4 -4
  101. data/app/views/spree/admin/promotion_categories/new.html.erb +4 -3
  102. data/app/views/spree/admin/promotion_rules/create.js.erb +1 -1
  103. data/app/views/spree/admin/promotions/_actions.html.erb +3 -3
  104. data/app/views/spree/admin/promotions/_rules.html.erb +2 -2
  105. data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +1 -1
  106. data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +1 -1
  107. data/app/views/spree/admin/promotions/edit.html.erb +4 -5
  108. data/app/views/spree/admin/promotions/index.html.erb +3 -5
  109. data/app/views/spree/admin/promotions/new.html.erb +3 -3
  110. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +2 -2
  111. data/app/views/spree/admin/properties/edit.html.erb +3 -6
  112. data/app/views/spree/admin/properties/index.html.erb +5 -5
  113. data/app/views/spree/admin/prototypes/_form.html.erb +3 -3
  114. data/app/views/spree/admin/prototypes/_prototypes.html.erb +1 -1
  115. data/app/views/spree/admin/prototypes/edit.html.erb +3 -6
  116. data/app/views/spree/admin/prototypes/index.html.erb +4 -4
  117. data/app/views/spree/admin/prototypes/show.html.erb +2 -2
  118. data/app/views/spree/admin/refund_reasons/edit.html.erb +4 -4
  119. data/app/views/spree/admin/refund_reasons/index.html.erb +5 -4
  120. data/app/views/spree/admin/refund_reasons/new.html.erb +5 -4
  121. data/app/views/spree/admin/refunds/edit.html.erb +5 -6
  122. data/app/views/spree/admin/refunds/new.html.erb +6 -6
  123. data/app/views/spree/admin/reimbursement_types/index.html.erb +4 -3
  124. data/app/views/spree/admin/reimbursements/edit.html.erb +5 -6
  125. data/app/views/spree/admin/reimbursements/index.html.erb +2 -4
  126. data/app/views/spree/admin/reimbursements/show.html.erb +3 -4
  127. data/app/views/spree/admin/reports/index.html.erb +2 -3
  128. data/app/views/spree/admin/reports/sales_total.html.erb +2 -4
  129. data/app/views/spree/admin/return_authorizations/edit.html.erb +15 -16
  130. data/app/views/spree/admin/return_authorizations/index.html.erb +3 -5
  131. data/app/views/spree/admin/return_authorizations/new.html.erb +5 -6
  132. data/app/views/spree/admin/return_reasons/edit.html.erb +3 -2
  133. data/app/views/spree/admin/return_reasons/index.html.erb +3 -1
  134. data/app/views/spree/admin/return_reasons/new.html.erb +4 -2
  135. data/app/views/spree/admin/shared/_areas_tabs.html.erb +3 -3
  136. data/app/views/spree/admin/shared/_configuration_menu.html.erb +2 -2
  137. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
  138. data/app/views/spree/admin/shared/_head.html.erb +1 -8
  139. data/app/views/spree/admin/shared/_header.html.erb +8 -12
  140. data/app/views/spree/admin/shared/_new_resource_links.html.erb +2 -2
  141. data/app/views/spree/admin/shared/_no_objects_found.html.erb +1 -1
  142. data/app/views/spree/admin/shared/_order_submenu.html.erb +10 -10
  143. data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
  144. data/app/views/spree/admin/shared/_order_tabs.html.erb +3 -3
  145. data/app/views/spree/admin/shared/_payments_tabs.html.erb +1 -1
  146. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +2 -2
  147. data/app/views/spree/admin/shared/_product_tabs.html.erb +8 -9
  148. data/app/views/spree/admin/shared/_report_criteria.html.erb +2 -2
  149. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +2 -2
  150. data/app/views/spree/admin/shared/_settings_checkout_tabs.html.erb +4 -4
  151. data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +5 -5
  152. data/app/views/spree/admin/shared/_shipping_tabs.html.erb +4 -3
  153. data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
  154. data/app/views/spree/admin/shared/_tabs.html.erb +12 -37
  155. data/app/views/spree/admin/shared/_taxes_tabs.html.erb +2 -2
  156. data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
  157. data/app/views/spree/admin/shared/named_types/_edit.html.erb +5 -5
  158. data/app/views/spree/admin/shared/named_types/_index.html.erb +5 -4
  159. data/app/views/spree/admin/shared/named_types/_new.html.erb +5 -4
  160. data/app/views/spree/admin/shipping_categories/edit.html.erb +5 -6
  161. data/app/views/spree/admin/shipping_categories/index.html.erb +5 -4
  162. data/app/views/spree/admin/shipping_categories/new.html.erb +5 -6
  163. data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
  164. data/app/views/spree/admin/shipping_methods/edit.html.erb +5 -6
  165. data/app/views/spree/admin/shipping_methods/index.html.erb +5 -5
  166. data/app/views/spree/admin/shipping_methods/new.html.erb +5 -6
  167. data/app/views/spree/admin/states/edit.html.erb +5 -6
  168. data/app/views/spree/admin/states/index.html.erb +5 -4
  169. data/app/views/spree/admin/states/new.html.erb +5 -3
  170. data/app/views/spree/admin/stock_items/index.html.erb +4 -7
  171. data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +2 -2
  172. data/app/views/spree/admin/stock_locations/edit.html.erb +5 -5
  173. data/app/views/spree/admin/stock_locations/index.html.erb +16 -9
  174. data/app/views/spree/admin/stock_locations/new.html.erb +5 -4
  175. data/app/views/spree/admin/stock_movements/index.html.erb +3 -4
  176. data/app/views/spree/admin/stock_movements/new.html.erb +2 -3
  177. data/app/views/spree/admin/stock_transfers/_location.html.erb +7 -0
  178. data/app/views/spree/admin/stock_transfers/_transfer_item_table.html.erb +1 -1
  179. data/app/views/spree/admin/stock_transfers/edit.html.erb +5 -6
  180. data/app/views/spree/admin/stock_transfers/index.html.erb +5 -5
  181. data/app/views/spree/admin/stock_transfers/new.html.erb +6 -8
  182. data/app/views/spree/admin/stock_transfers/receive.html.erb +4 -12
  183. data/app/views/spree/admin/stock_transfers/show.html.erb +6 -12
  184. data/app/views/spree/admin/stock_transfers/tracking_info.html.erb +5 -13
  185. data/app/views/spree/admin/store_credits/edit_amount.html.erb +6 -4
  186. data/app/views/spree/admin/store_credits/edit_validity.html.erb +8 -6
  187. data/app/views/spree/admin/store_credits/index.html.erb +5 -5
  188. data/app/views/spree/admin/store_credits/new.html.erb +5 -4
  189. data/app/views/spree/admin/store_credits/show.html.erb +5 -4
  190. data/app/views/spree/admin/style_guide/topics/typography/_icons.html.erb +2 -2
  191. data/app/views/spree/admin/tax_categories/edit.html.erb +5 -4
  192. data/app/views/spree/admin/tax_categories/index.html.erb +5 -4
  193. data/app/views/spree/admin/tax_categories/new.html.erb +5 -4
  194. data/app/views/spree/admin/tax_rates/edit.html.erb +5 -6
  195. data/app/views/spree/admin/tax_rates/index.html.erb +5 -4
  196. data/app/views/spree/admin/tax_rates/new.html.erb +5 -6
  197. data/app/views/spree/admin/taxonomies/edit.erb +7 -9
  198. data/app/views/spree/admin/taxonomies/index.html.erb +4 -4
  199. data/app/views/spree/admin/taxonomies/new.html.erb +5 -7
  200. data/app/views/spree/admin/taxons/edit.html.erb +5 -6
  201. data/app/views/spree/admin/taxons/index.html.erb +2 -3
  202. data/app/views/spree/admin/trackers/edit.html.erb +5 -6
  203. data/app/views/spree/admin/trackers/index.html.erb +4 -4
  204. data/app/views/spree/admin/trackers/new.html.erb +4 -6
  205. data/app/views/spree/admin/users/_form.html.erb +2 -2
  206. data/app/views/spree/admin/users/_tabs.html.erb +5 -5
  207. data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -4
  208. data/app/views/spree/admin/users/addresses.html.erb +5 -4
  209. data/app/views/spree/admin/users/edit.html.erb +6 -6
  210. data/app/views/spree/admin/users/index.html.erb +4 -5
  211. data/app/views/spree/admin/users/items.html.erb +4 -3
  212. data/app/views/spree/admin/users/new.html.erb +2 -9
  213. data/app/views/spree/admin/users/orders.html.erb +4 -3
  214. data/app/views/spree/admin/variants/_form.html.erb +1 -0
  215. data/app/views/spree/admin/variants/edit.html.erb +4 -3
  216. data/app/views/spree/admin/variants/index.html.erb +10 -8
  217. data/app/views/spree/admin/variants/new.html.erb +5 -0
  218. data/app/views/spree/admin/zones/_country_members.html.erb +2 -2
  219. data/app/views/spree/admin/zones/_state_members.html.erb +2 -2
  220. data/app/views/spree/admin/zones/edit.html.erb +5 -6
  221. data/app/views/spree/admin/zones/index.html.erb +5 -4
  222. data/app/views/spree/admin/zones/new.html.erb +6 -7
  223. data/app/views/spree/layouts/admin.html.erb +28 -15
  224. data/config/initializers/form_builder.rb +6 -0
  225. data/config/routes.rb +2 -6
  226. data/spec/controllers/spree/admin/cancellations_controller_spec.rb +3 -3
  227. data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +4 -4
  228. data/spec/controllers/spree/admin/missing_products_controller_spec.rb +1 -1
  229. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +5 -5
  230. data/spec/controllers/spree/admin/orders_controller_spec.rb +28 -28
  231. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +5 -5
  232. data/spec/controllers/spree/admin/payments_controller_spec.rb +7 -7
  233. data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -2
  234. data/spec/controllers/spree/admin/product_properties_controller_spec.rb +1 -1
  235. data/spec/controllers/spree/admin/products_controller_spec.rb +6 -6
  236. data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -2
  237. data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +1 -1
  238. data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +2 -2
  239. data/spec/controllers/spree/admin/promotions_controller_spec.rb +7 -7
  240. data/spec/controllers/spree/admin/refunds_controller_spec.rb +1 -1
  241. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +5 -5
  242. data/spec/controllers/spree/admin/reports_controller_spec.rb +2 -2
  243. data/spec/controllers/spree/admin/resource_controller_spec.rb +6 -6
  244. data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +11 -11
  245. data/spec/controllers/spree/admin/return_items_controller_spec.rb +1 -1
  246. data/spec/controllers/spree/admin/search_controller_spec.rb +2 -2
  247. data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +1 -1
  248. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +3 -3
  249. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +3 -3
  250. data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +10 -10
  251. data/spec/controllers/spree/admin/store_credits_controller_spec.rb +10 -10
  252. data/spec/controllers/spree/admin/users_controller_spec.rb +139 -141
  253. data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -2
  254. data/spec/features/admin/configuration/general_settings_spec.rb +7 -16
  255. data/spec/features/admin/configuration/payment_methods_spec.rb +7 -7
  256. data/spec/features/admin/configuration/stock_locations_spec.rb +1 -1
  257. data/spec/features/admin/configuration/tax_categories_spec.rb +1 -1
  258. data/spec/features/admin/configuration/zones_spec.rb +1 -1
  259. data/spec/features/admin/homepage_spec.rb +2 -2
  260. data/spec/features/admin/orders/adjustments_spec.rb +1 -1
  261. data/spec/features/admin/orders/cancelling_inventory_spec.rb +8 -8
  262. data/spec/features/admin/orders/customer_details_spec.rb +20 -5
  263. data/spec/features/admin/orders/listing_spec.rb +97 -70
  264. data/spec/features/admin/orders/new_order_spec.rb +35 -6
  265. data/spec/features/admin/orders/order_details_spec.rb +37 -58
  266. data/spec/features/admin/orders/payments_spec.rb +57 -4
  267. data/spec/features/admin/orders/return_authorizations_spec.rb +25 -0
  268. data/spec/features/admin/orders/shipments_spec.rb +5 -5
  269. data/spec/features/admin/products/edit/products_spec.rb +1 -1
  270. data/spec/features/admin/products/edit/taxons_spec.rb +5 -5
  271. data/spec/features/admin/products/edit/variants_spec.rb +1 -1
  272. data/spec/features/admin/products/option_types_spec.rb +2 -2
  273. data/spec/features/admin/products/products_spec.rb +6 -6
  274. data/spec/features/admin/products/properties_spec.rb +6 -6
  275. data/spec/features/admin/products/prototypes_spec.rb +1 -1
  276. data/spec/features/admin/products/stock_management_spec.rb +5 -5
  277. data/spec/features/admin/promotion_adjustments_spec.rb +8 -8
  278. data/spec/features/admin/promotions/option_value_rule_spec.rb +4 -4
  279. data/spec/features/admin/promotions/product_rule_spec.rb +33 -0
  280. data/spec/features/admin/promotions/tiered_calculator_spec.rb +2 -2
  281. data/spec/features/admin/promotions/user_rule_spec.rb +15 -0
  282. data/spec/features/admin/reports_spec.rb +1 -1
  283. data/spec/features/admin/users_spec.rb +27 -2
  284. data/spec/helpers/admin/base_helper_spec.rb +30 -0
  285. data/spec/helpers/admin/navigation_helper_spec.rb +40 -2
  286. data/spec/spec_helper.rb +10 -8
  287. data/spec/support/feature/order_feature_helper.rb +17 -0
  288. metadata +18 -11
  289. data/app/assets/javascripts/spree/backend/general_settings.js.coffee +0 -13
  290. data/spec/controllers/spree/admin/general_settings_controller_spec.rb +0 -41
@@ -73,16 +73,16 @@ describe "Payment Methods", type: :feature do
73
73
  create(:credit_card_payment_method)
74
74
  click_link "Payment Methods"
75
75
  click_icon :edit
76
- expect(page).to have_content('TEST MODE')
76
+ expect(page).to have_content('Test Mode')
77
77
 
78
78
  select2_search 'Spree::PaymentMethod::Check', from: 'Provider'
79
79
  expect(page).to have_content('you must save first')
80
- expect(page).to have_no_content('TEST MODE')
80
+ expect(page).to have_no_content('Test Mode')
81
81
 
82
82
  # change back
83
83
  select2_search 'Spree::Gateway::Bogus', from: 'Provider'
84
84
  expect(page).to have_no_content('you must save first')
85
- expect(page).to have_content('TEST MODE')
85
+ expect(page).to have_content('Test Mode')
86
86
  end
87
87
 
88
88
  it "displays message when changing preference source" do
@@ -91,16 +91,16 @@ describe "Payment Methods", type: :feature do
91
91
  create(:credit_card_payment_method)
92
92
  click_link "Payment Methods"
93
93
  click_icon :edit
94
- expect(page).to have_content('TEST MODE')
94
+ expect(page).to have_content('Test Mode')
95
95
 
96
96
  select2_search 'my_prefs', from: 'Preference Source'
97
97
  expect(page).to have_content('you must save first')
98
- expect(page).to have_no_content('TEST MODE')
98
+ expect(page).to have_no_content('Test Mode')
99
99
 
100
100
  # change back
101
101
  select2_search 'Custom', from: 'Preference Source'
102
102
  expect(page).to have_no_content('you must save first')
103
- expect(page).to have_content('TEST MODE')
103
+ expect(page).to have_content('Test Mode')
104
104
  end
105
105
 
106
106
  it "updates successfully and keeps secrets" do
@@ -118,7 +118,7 @@ describe "Payment Methods", type: :feature do
118
118
  # change back
119
119
  select2_search 'Custom', from: 'Preference Source'
120
120
  click_on 'Update'
121
- expect(page).to have_content('TEST MODE')
121
+ expect(page).to have_content('Test Mode')
122
122
  expect(page).to have_no_content('secret')
123
123
  end
124
124
  end
@@ -32,7 +32,7 @@ describe "Stock Locations", type: :feature do
32
32
  # Wait for API request to complete.
33
33
  wait_for_ajax
34
34
  visit current_path
35
- expect(page).to have_content("NO STOCK LOCATIONS FOUND")
35
+ expect(page).to have_content("No Stock Locations found")
36
36
  end
37
37
 
38
38
  it "can update an existing stock location" do
@@ -12,7 +12,7 @@ describe "Tax Categories", type: :feature do
12
12
  it "should display the existing tax categories" do
13
13
  create(:tax_category, name: "Clothing", tax_code: "CL001", description: "For Clothing")
14
14
  click_link "Tax Categories"
15
- expect(page).to have_content("Listing Tax Categories")
15
+ expect(page).to have_content("SettingsTaxesTax Categories")
16
16
  within_row(1) do
17
17
  expect(column_text(1)).to eq("Clothing")
18
18
  expect(column_text(2)).to eq("CL001")
@@ -6,7 +6,7 @@ describe "Zones", type: :feature do
6
6
  before(:each) do
7
7
  Spree::Zone.delete_all
8
8
  visit spree.admin_path
9
- click_link "Areas"
9
+ click_link "Locations"
10
10
  end
11
11
 
12
12
  context "show" do
@@ -43,8 +43,8 @@ describe "Homepage", type: :feature do
43
43
  within('.selected .admin-subnav') { page.find_link("Option Types")['/admin/option_types'] }
44
44
  end
45
45
 
46
- it "should have a link to properties" do
47
- within('.selected .admin-subnav') { page.find_link("Properties")['/admin/properties'] }
46
+ it "should have a link to property types" do
47
+ within('.selected .admin-subnav') { page.find_link("Property Types")['/admin/properties'] }
48
48
  end
49
49
 
50
50
  it "should have a link to prototypes" do
@@ -119,7 +119,7 @@ describe "Adjustments", type: :feature do
119
119
  end
120
120
  end
121
121
 
122
- expect(page).to have_content(/TOTAL: ?\$170\.00/)
122
+ expect(page).to have_content(/Total: ?\$170\.00/)
123
123
  end
124
124
  end
125
125
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Cancelling inventory" do
3
+ describe "Cancel items" do
4
4
  stub_authorization!
5
5
 
6
6
  let!(:order) do
@@ -20,29 +20,29 @@ describe "Cancelling inventory" do
20
20
  end
21
21
  end
22
22
 
23
- context "when some inventory is cancelable" do
24
- it "can cancel the inventory" do
23
+ context "when some items are cancelable" do
24
+ it "can cancel the item" do
25
25
  visit_order
26
26
 
27
- click_link 'Cancel Inventory'
27
+ click_link 'Cancel Items'
28
28
 
29
29
  within_row(1) do
30
30
  check 'inventory_unit_ids[]'
31
31
  end
32
32
 
33
- click_button "Cancel Inventory"
33
+ click_button "Cancel Items"
34
34
  expect(page).to have_content("Inventory canceled")
35
35
  expect(page).to have_content("1 x canceled")
36
36
  end
37
37
  end
38
38
 
39
- context "when all inventory is not cancelable" do
39
+ context "when all items are not cancelable" do
40
40
  before { order.inventory_units.each(&:cancel!) }
41
41
 
42
- it "does not display the link to cancel inventory" do
42
+ it "does not display the link to cancel items" do
43
43
  visit_order
44
44
 
45
- expect(page).to have_no_content('Cancel Inventory')
45
+ expect(page).to have_no_content('Cancel Items')
46
46
  end
47
47
  end
48
48
  end
@@ -16,20 +16,25 @@ describe "Customer Details", type: :feature, js: true do
16
16
  let!(:user) { create(:user, email: 'foobar@example.com', ship_address: ship_address, bill_address: bill_address) }
17
17
 
18
18
  context "brand new order" do
19
- # Regression test for https://github.com/spree/spree/issues/3335 and https://github.com/spree/spree/issues/5317
20
- it "associates a user when not using guest checkout" do
19
+ let(:quantity) { 1 }
20
+
21
+ before do
21
22
  visit spree.admin_path
22
23
  click_link "Orders"
23
24
  click_link "New Order"
24
25
  click_on 'Cart'
25
26
  select2_search product.name, from: Spree.t(:name_or_sku)
26
27
  within("table.stock-levels") do
27
- find('.variant_quantity').set(1)
28
+ find('.variant_quantity').set(quantity)
28
29
  end
29
- click_icon :plus
30
+ click_button 'Add'
30
31
  expect(page).to have_css('.line-item')
31
32
  click_link "Customer"
32
33
  targetted_select2 "foobar@example.com", from: "#s2id_customer_search"
34
+ end
35
+
36
+ # Regression test for https://github.com/spree/spree/issues/3335 and https://github.com/spree/spree/issues/5317
37
+ it "associates a user when not using guest checkout" do
33
38
  # 5317 - Address prefills using user's default.
34
39
  expect(page).to have_field('First Name', with: user.bill_address.firstname)
35
40
  expect(page).to have_field('Last Name', with: user.bill_address.lastname)
@@ -43,6 +48,16 @@ describe "Customer Details", type: :feature, js: true do
43
48
  click_button "Update"
44
49
  expect(Spree::Order.last.user).not_to be_nil
45
50
  end
51
+
52
+ context "when required quantity is more than available" do
53
+ let(:quantity) { 11 }
54
+ let!(:product) { create(:product_not_backorderable) }
55
+
56
+ it "displays an error" do
57
+ click_button "Update"
58
+ expect(page).to have_content Spree.t(:insufficient_stock_for_order)
59
+ end
60
+ end
46
61
  end
47
62
 
48
63
  context "editing an order" do
@@ -89,7 +104,7 @@ describe "Customer Details", type: :feature, js: true do
89
104
  # Regression test for https://github.com/spree/spree/issues/2950 and https://github.com/spree/spree/issues/2433
90
105
  # This act should transition the state of the order as far as it will go too
91
106
  within("#order_tab_summary") do
92
- expect(find("dt#order_status + dd")).to have_content("COMPLETE")
107
+ expect(find("dt#order_status + dd")).to have_content("complete")
93
108
  end
94
109
  end
95
110
 
@@ -17,7 +17,7 @@ describe "Orders Listing", type: :feature, js: true do
17
17
  it "should list existing orders" do
18
18
  within_row(1) do
19
19
  expect(column_text(2)).to eq "R100"
20
- expect(column_text(3)).to eq "CART"
20
+ expect(column_text(3)).to eq "cart"
21
21
  end
22
22
 
23
23
  within_row(2) do
@@ -45,105 +45,132 @@ describe "Orders Listing", type: :feature, js: true do
45
45
  end
46
46
 
47
47
  context "searching orders" do
48
- it "should be able to search orders" do
49
- click_on 'Filter'
50
- fill_in "q_number_cont", with: "R200"
51
- click_on 'Filter Results'
52
- within_row(1) do
53
- expect(page).to have_content("R200")
48
+ context "when there are multiple stores" do
49
+ let(:stores) { FactoryGirl.create_pair(:store) }
50
+
51
+ before do
52
+ stores.each do |store|
53
+ FactoryGirl.create(:completed_order_with_totals, number: "R#{store.id}999", store: store)
54
+ end
54
55
  end
55
56
 
56
- # Ensure that the other order doesn't show up
57
- within("table#listing_orders") { expect(page).not_to have_content("R100") }
58
- end
57
+ it "can find the orders belonging to a specific store" do
58
+ main_store, other_store = stores
59
59
 
60
- it "should be able to filter on variant_id" do
61
- click_on 'Filter'
62
- select2_search @order1.products.first.sku, from: Spree.t(:variant)
63
- click_on 'Filter Results'
60
+ click_on "Filter"
61
+ select2 main_store.name, from: Spree.t(:store)
62
+ click_on "Filter Results"
64
63
 
65
- within_row(1) do
66
- expect(page).to have_content(@order1.number)
67
- end
64
+ within_row(1) do
65
+ expect(page).to have_content("R#{main_store.id}999")
66
+ end
68
67
 
69
- expect(page).not_to have_content(@order2.number)
68
+ # Ensure that the other order doesn't show up
69
+ within("table#listing_orders") { expect(page).not_to have_content("R#{other_store.id}999") }
70
+ end
70
71
  end
71
72
 
72
- context "when pagination is really short" do
73
- before do
74
- @old_per_page = Spree::Config[:orders_per_page]
75
- Spree::Config[:orders_per_page] = 1
76
- end
73
+ context "when there's a single store" do
74
+ it "should be able to search orders" do
75
+ click_on 'Filter'
76
+ fill_in "q_number_cont", with: "R200"
77
+ click_on 'Filter Results'
78
+ within_row(1) do
79
+ expect(page).to have_content("R200")
80
+ end
77
81
 
78
- after do
79
- Spree::Config[:orders_per_page] = @old_per_page
82
+ # Ensure that the other order doesn't show up
83
+ within("table#listing_orders") { expect(page).not_to have_content("R100") }
80
84
  end
81
85
 
82
- # Regression test for https://github.com/spree/spree/issues/4004
83
- it "should be able to go from page to page for incomplete orders" do
84
- 10.times { Spree::Order.create email: "incomplete@example.com" }
86
+ it "should be able to filter on variant_id" do
85
87
  click_on 'Filter'
86
- uncheck "q_completed_at_not_null"
88
+ select2_search @order1.products.first.sku, from: Spree.t(:variant)
87
89
  click_on 'Filter Results'
88
- within(".pagination", match: :first) do
89
- click_link "2"
90
- end
91
- expect(page).to have_content("incomplete@example.com")
92
- click_on 'Filter'
93
- expect(find("#q_completed_at_not_null")).not_to be_checked
94
- end
95
- end
96
90
 
97
- it "should be able to search orders using only completed at input" do
98
- click_on 'Filter'
99
- fill_in "q_created_at_gt", with: Date.current
91
+ within_row(1) do
92
+ expect(page).to have_content(@order1.number)
93
+ end
100
94
 
101
- # Just so the datepicker gets out of poltergeists way.
102
- page.execute_script("$('#q_created_at_gt').datepicker('widget').hide();")
95
+ expect(page).not_to have_content(@order2.number)
96
+ end
103
97
 
104
- click_on 'Filter Results'
105
- within_row(1) { expect(page).to have_content("R100") }
98
+ context "when pagination is really short" do
99
+ before do
100
+ @old_per_page = Spree::Config[:orders_per_page]
101
+ Spree::Config[:orders_per_page] = 1
102
+ end
106
103
 
107
- # Ensure that the other order doesn't show up
108
- within("table#listing_orders") { expect(page).not_to have_content("R200") }
109
- end
104
+ after do
105
+ Spree::Config[:orders_per_page] = @old_per_page
106
+ end
110
107
 
111
- context "filter on promotions" do
112
- before(:each) do
113
- @order1.order_promotions.build(
114
- promotion: promotion,
115
- promotion_code: promotion_code
116
- )
117
- @order1.save
118
- visit spree.admin_orders_path
108
+ # Regression test for https://github.com/spree/spree/issues/4004
109
+ it "should be able to go from page to page for incomplete orders" do
110
+ 10.times { Spree::Order.create email: "incomplete@example.com" }
111
+ click_on 'Filter'
112
+ uncheck "q_completed_at_not_null"
113
+ click_on 'Filter Results'
114
+ within(".pagination", match: :first) do
115
+ click_link "2"
116
+ end
117
+ expect(page).to have_content("incomplete@example.com")
118
+ click_on 'Filter'
119
+ expect(find("#q_completed_at_not_null")).not_to be_checked
120
+ end
119
121
  end
120
122
 
121
- it "only shows the orders with the selected promotion" do
123
+ it "should be able to search orders using only completed at input" do
122
124
  click_on 'Filter'
123
- fill_in "q_promotions_codes_value_cont", with: promotion.codes.first.value
125
+ fill_in "q_created_at_gt", with: Date.current
126
+
127
+ # Just so the datepicker gets out of poltergeists way.
128
+ page.execute_script("$('#q_created_at_gt').datepicker('widget').hide();")
129
+
124
130
  click_on 'Filter Results'
125
131
  within_row(1) { expect(page).to have_content("R100") }
132
+
133
+ # Ensure that the other order doesn't show up
126
134
  within("table#listing_orders") { expect(page).not_to have_content("R200") }
127
135
  end
128
- end
129
136
 
130
- context "when toggling the completed orders checkbox" do
131
- before do
132
- create(:order, number: 'R300', completed_at: nil, state: 'cart')
137
+ context "filter on promotions" do
138
+ before(:each) do
139
+ @order1.order_promotions.build(
140
+ promotion: promotion,
141
+ promotion_code: promotion_code
142
+ )
143
+ @order1.save
144
+ visit spree.admin_orders_path
145
+ end
146
+
147
+ it "only shows the orders with the selected promotion" do
148
+ click_on 'Filter'
149
+ fill_in "q_promotions_codes_value_cont", with: promotion.codes.first.value
150
+ click_on 'Filter Results'
151
+ within_row(1) { expect(page).to have_content("R100") }
152
+ within("table#listing_orders") { expect(page).not_to have_content("R200") }
153
+ end
133
154
  end
134
155
 
135
- it "shows both complete and incomplete orders" do
136
- check "q_completed_at_not_null"
137
- click_on 'Filter'
156
+ context "when toggling the completed orders checkbox" do
157
+ before do
158
+ create(:order, number: 'R300', completed_at: nil, state: 'cart')
159
+ end
138
160
 
139
- expect(page).to have_content("R200")
140
- expect(page).to_not have_content("R300")
161
+ it "shows both complete and incomplete orders" do
162
+ check "q_completed_at_not_null"
163
+ click_on 'Filter'
141
164
 
142
- uncheck "q_completed_at_not_null"
143
- click_on 'Filter Results'
165
+ expect(page).to have_content("R200")
166
+ expect(page).to_not have_content("R300")
144
167
 
145
- expect(page).to have_content("R200")
146
- expect(page).to have_content("R300")
168
+ uncheck "q_completed_at_not_null"
169
+ click_on 'Filter Results'
170
+
171
+ expect(page).to have_content("R200")
172
+ expect(page).to have_content("R300")
173
+ end
147
174
  end
148
175
  end
149
176
  end
@@ -28,7 +28,7 @@ describe "New Order", type: :feature do
28
28
 
29
29
  fill_in_quantity("table.stock-levels", "quantity_0", 2)
30
30
 
31
- click_icon :plus
31
+ click_button 'Add'
32
32
  click_on "Customer"
33
33
 
34
34
  within "#select-customer" do
@@ -56,10 +56,39 @@ describe "New Order", type: :feature do
56
56
  click_on "ship"
57
57
 
58
58
  within '.carton-state' do
59
- expect(page).to have_content('SHIPPED')
59
+ expect(page).to have_content('shipped')
60
60
  end
61
61
  end
62
62
 
63
+ it 'can create split payments', js: true do
64
+ click_on 'Cart'
65
+ select2_search product.name, from: Spree.t(:name_or_sku)
66
+
67
+ fill_in_quantity("table.stock-levels", "quantity_0", 2)
68
+
69
+ click_button 'Add'
70
+ click_on "Customer"
71
+
72
+ within "#select-customer" do
73
+ targetted_select2_search user.email, from: "#s2id_customer_search"
74
+ end
75
+
76
+ check "order_use_billing"
77
+ fill_in_address
78
+ click_on "Update"
79
+
80
+ click_on "Payments"
81
+ fill_in "Amount", with: '10.00'
82
+ click_on 'Update'
83
+
84
+ click_on 'New Payment'
85
+ fill_in "Amount", with: '29.98'
86
+ click_on 'Update'
87
+
88
+ expect(page).to have_content("$10.00")
89
+ expect(page).to have_content("$29.98")
90
+ end
91
+
63
92
  context "adding new item to the order", js: true do
64
93
  it "inventory items show up just fine and are also registered as shipments" do
65
94
  click_on 'Cart'
@@ -67,7 +96,7 @@ describe "New Order", type: :feature do
67
96
 
68
97
  fill_in_quantity('table.stock-levels', 'quantity_0', 2)
69
98
 
70
- click_icon :plus
99
+ click_button 'Add'
71
100
 
72
101
  within(".line-items") do
73
102
  expect(page).to have_content(product.name)
@@ -103,7 +132,7 @@ describe "New Order", type: :feature do
103
132
 
104
133
  fill_in_quantity('table.stock-levels', 'quantity_0', 1)
105
134
 
106
- click_icon :plus
135
+ click_button 'Add'
107
136
 
108
137
  within(".line-items") do
109
138
  within(".line-item-name") do
@@ -144,7 +173,7 @@ describe "New Order", type: :feature do
144
173
  click_on "Continue"
145
174
 
146
175
  within(".additional-info .state") do
147
- expect(page).to have_content("CONFIRM")
176
+ expect(page).to have_content("confirm")
148
177
  end
149
178
  end
150
179
  end
@@ -161,7 +190,7 @@ describe "New Order", type: :feature do
161
190
  find('.variant_quantity').set(1)
162
191
  end
163
192
 
164
- click_icon :plus
193
+ click_button 'Add'
165
194
 
166
195
  expect(page).to have_css('.line-item')
167
196