solidus_backend 1.1.4 → 1.2.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 (205) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/solidus-style-guide-logo.png +0 -0
  3. data/app/assets/javascripts/spree/backend/admin.js.erb +1 -7
  4. data/app/assets/javascripts/spree/backend/checkouts/edit.js +2 -2
  5. data/app/assets/javascripts/spree/backend/navigation.coffee +10 -0
  6. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js.erb +6 -6
  7. data/app/assets/javascripts/spree/backend/option_value_picker.js +6 -6
  8. data/app/assets/javascripts/spree/backend/product_picker.js +6 -6
  9. data/app/assets/javascripts/spree/backend/shipments.js.erb +17 -3
  10. data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +2 -2
  11. data/app/assets/javascripts/spree/backend/style_guide.coffee +2 -0
  12. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb +6 -6
  13. data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +82 -109
  14. data/app/assets/javascripts/spree/backend/taxons.js.coffee +4 -5
  15. data/app/assets/javascripts/spree/backend/user_picker.js +8 -8
  16. data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee.erb +3 -3
  17. data/app/assets/javascripts/spree/backend.js +3 -6
  18. data/app/assets/stylesheets/spree/backend/components/_messages.scss +1 -4
  19. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +99 -115
  20. data/app/assets/stylesheets/spree/backend/components/_progress.scss +1 -1
  21. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +6 -0
  22. data/app/assets/stylesheets/spree/backend/globals/_variables.scss +18 -0
  23. data/app/assets/stylesheets/spree/backend/globals/mixins/_caret.scss +35 -0
  24. data/app/assets/stylesheets/spree/backend/plugins/_powertip.scss +1 -0
  25. data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +132 -0
  26. data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +60 -0
  27. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +2 -0
  28. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +36 -4
  29. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +3 -6
  30. data/app/assets/stylesheets/spree/backend/spree_admin.scss +4 -1
  31. data/app/assets/stylesheets/spree/backend.css +1 -1
  32. data/app/controllers/spree/admin/orders_controller.rb +6 -6
  33. data/app/controllers/spree/admin/payment_methods_controller.rb +1 -1
  34. data/app/controllers/spree/admin/payments_controller.rb +1 -1
  35. data/app/controllers/spree/admin/products_controller.rb +0 -1
  36. data/app/controllers/spree/admin/reports_controller.rb +2 -2
  37. data/app/controllers/spree/admin/search_controller.rb +9 -7
  38. data/app/controllers/spree/admin/stock_transfers_controller.rb +6 -14
  39. data/app/controllers/spree/admin/style_guide_controller.rb +33 -0
  40. data/app/helpers/spree/admin/adjustments_helper.rb +2 -6
  41. data/app/helpers/spree/admin/base_helper.rb +7 -6
  42. data/app/helpers/spree/admin/navigation_helper.rb +12 -5
  43. data/app/helpers/spree/admin/orders_helper.rb +1 -1
  44. data/app/helpers/spree/admin/products_helper.rb +2 -4
  45. data/app/helpers/spree/admin/stock_movements_helper.rb +3 -3
  46. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
  47. data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +1 -1
  48. data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +1 -1
  49. data/app/views/spree/admin/customer_returns/edit.html.erb +1 -1
  50. data/app/views/spree/admin/images/edit.html.erb +1 -3
  51. data/app/views/spree/admin/images/index.html.erb +0 -2
  52. data/app/views/spree/admin/option_types/edit.html.erb +2 -4
  53. data/app/views/spree/admin/option_types/index.html.erb +0 -2
  54. data/app/views/spree/admin/option_types/new.html.erb +0 -2
  55. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
  56. data/app/views/spree/admin/orders/index.html.erb +1 -1
  57. data/app/views/spree/admin/product_properties/index.html.erb +0 -1
  58. data/app/views/spree/admin/products/edit.html.erb +0 -2
  59. data/app/views/spree/admin/products/index.html.erb +2 -4
  60. data/app/views/spree/admin/products/new.html.erb +0 -2
  61. data/app/views/spree/admin/promotion_categories/edit.html.erb +0 -2
  62. data/app/views/spree/admin/promotion_categories/index.html.erb +0 -2
  63. data/app/views/spree/admin/promotion_categories/new.html.erb +0 -2
  64. data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +2 -28
  65. data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +2 -26
  66. data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +28 -0
  67. data/app/views/spree/admin/promotions/edit.html.erb +0 -2
  68. data/app/views/spree/admin/promotions/index.html.erb +0 -2
  69. data/app/views/spree/admin/promotions/new.html.erb +0 -2
  70. data/app/views/spree/admin/properties/edit.html.erb +0 -2
  71. data/app/views/spree/admin/properties/index.html.erb +2 -4
  72. data/app/views/spree/admin/properties/new.html.erb +0 -2
  73. data/app/views/spree/admin/properties/new.js.erb +1 -1
  74. data/app/views/spree/admin/prototypes/edit.html.erb +0 -2
  75. data/app/views/spree/admin/prototypes/index.html.erb +0 -2
  76. data/app/views/spree/admin/prototypes/new.html.erb +0 -2
  77. data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
  78. data/app/views/spree/admin/reimbursements/show.html.erb +9 -9
  79. data/app/views/spree/admin/return_authorizations/_form.html.erb +16 -16
  80. data/app/views/spree/admin/search/users.rabl +1 -1
  81. data/app/views/spree/admin/shared/_head.html.erb +11 -0
  82. data/app/views/spree/admin/shared/_header.html.erb +4 -8
  83. data/app/views/spree/admin/shared/_menu.html.erb +4 -8
  84. data/app/views/spree/admin/shared/_navigation.html.erb +9 -0
  85. data/app/views/spree/admin/shared/_navigation_footer.html.erb +3 -0
  86. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +20 -22
  87. data/app/views/spree/admin/shared/_promotion_sub_menu.html.erb +8 -10
  88. data/app/views/spree/admin/shared/_stock_sub_menu.html.erb +8 -10
  89. data/app/views/spree/admin/shared/_tabs.html.erb +9 -3
  90. data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
  91. data/app/views/spree/admin/stock_items/index.html.erb +1 -2
  92. data/app/views/spree/admin/stock_transfers/edit.html.erb +0 -1
  93. data/app/views/spree/admin/stock_transfers/index.html.erb +0 -3
  94. data/app/views/spree/admin/stock_transfers/new.html.erb +0 -2
  95. data/app/views/spree/admin/stock_transfers/receive.html.erb +0 -2
  96. data/app/views/spree/admin/stock_transfers/show.html.erb +0 -2
  97. data/app/views/spree/admin/stock_transfers/tracking_info.html.erb +0 -2
  98. data/app/views/spree/admin/style_guide/index.html.erb +5 -0
  99. data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +79 -0
  100. data/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb +14 -0
  101. data/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +13 -0
  102. data/app/views/spree/admin/style_guide/topics/messaging/_loading.html.erb +20 -0
  103. data/app/views/spree/admin/style_guide/topics/messaging/_tooltips.html.erb +16 -0
  104. data/app/views/spree/admin/style_guide/topics/tables/_building_tables.html.erb +44 -0
  105. data/app/views/spree/admin/style_guide/topics/tables/_pagination.html.erb +11 -0
  106. data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +64 -0
  107. data/app/views/spree/admin/style_guide/topics/typography/_fonts.html.erb +19 -0
  108. data/app/views/spree/admin/style_guide/topics/typography/_icons.html.erb +13 -0
  109. data/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +25 -0
  110. data/app/views/spree/admin/style_guide/topics/typography/_tags.html.erb +25 -0
  111. data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -0
  112. data/app/views/spree/admin/taxonomies/edit.erb +5 -6
  113. data/app/views/spree/admin/taxonomies/index.html.erb +0 -2
  114. data/app/views/spree/admin/taxonomies/new.html.erb +0 -2
  115. data/app/views/spree/admin/taxons/_form.html.erb +1 -1
  116. data/app/views/spree/admin/taxons/_list_template.html.erb +17 -0
  117. data/app/views/spree/admin/taxons/index.html.erb +0 -3
  118. data/app/views/spree/admin/users/orders.html.erb +1 -1
  119. data/app/views/spree/admin/variants/edit.html.erb +0 -2
  120. data/app/views/spree/admin/variants/index.html.erb +0 -2
  121. data/app/views/spree/layouts/admin.html.erb +3 -4
  122. data/app/views/spree/layouts/admin_style_guide.html.erb +58 -0
  123. data/config/routes.rb +4 -2
  124. data/lib/spree/backend/engine.rb +0 -1
  125. data/lib/spree/backend.rb +0 -3
  126. data/solidus_backend.gemspec +5 -7
  127. data/spec/controllers/spree/admin/missing_products_controller_spec.rb +1 -1
  128. data/spec/controllers/spree/admin/orders_controller_spec.rb +14 -14
  129. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -4
  130. data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -2
  131. data/spec/controllers/spree/admin/products_controller_spec.rb +3 -3
  132. data/spec/controllers/spree/admin/reports_controller_spec.rb +4 -4
  133. data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +1 -1
  134. data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +1 -1
  135. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +1 -1
  136. data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +13 -11
  137. data/spec/features/admin/configuration/general_settings_spec.rb +10 -7
  138. data/spec/features/admin/configuration/payment_methods_spec.rb +1 -1
  139. data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
  140. data/spec/features/admin/configuration/states_spec.rb +1 -1
  141. data/spec/features/admin/configuration/tax_rates_spec.rb +6 -7
  142. data/spec/features/admin/configuration/taxonomies_spec.rb +3 -3
  143. data/spec/features/admin/homepage_spec.rb +6 -6
  144. data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +4 -8
  145. data/spec/features/admin/orders/customer_details_spec.rb +9 -8
  146. data/spec/features/admin/orders/line_items_spec.rb +1 -1
  147. data/spec/features/admin/orders/listing_spec.rb +2 -2
  148. data/spec/features/admin/orders/log_entries_spec.rb +3 -3
  149. data/spec/features/admin/orders/new_order_spec.rb +3 -15
  150. data/spec/features/admin/orders/order_details_spec.rb +17 -20
  151. data/spec/features/admin/orders/payments_spec.rb +10 -10
  152. data/spec/features/admin/orders/shipments_spec.rb +2 -2
  153. data/spec/features/admin/products/edit/images_spec.rb +5 -3
  154. data/spec/features/admin/products/edit/products_spec.rb +11 -11
  155. data/spec/features/admin/products/edit/taxons_spec.rb +14 -38
  156. data/spec/features/admin/products/edit/variants_spec.rb +3 -3
  157. data/spec/features/admin/products/option_types_spec.rb +22 -21
  158. data/spec/features/admin/products/products_spec.rb +15 -12
  159. data/spec/features/admin/products/properties_spec.rb +3 -3
  160. data/spec/features/admin/products/prototypes_spec.rb +4 -4
  161. data/spec/features/admin/products/stock_management_spec.rb +5 -5
  162. data/spec/features/admin/products/variant_spec.rb +8 -8
  163. data/spec/features/admin/promotion_adjustments_spec.rb +6 -13
  164. data/spec/features/admin/promotions/option_value_rule_spec.rb +0 -20
  165. data/spec/features/admin/reports_spec.rb +2 -2
  166. data/spec/features/admin/stock_transfer_spec.rb +3 -3
  167. data/spec/features/admin/store_credits_spec.rb +2 -2
  168. data/spec/features/admin/users_spec.rb +6 -6
  169. data/spec/helpers/admin/navigation_helper_spec.rb +5 -0
  170. data/spec/helpers/admin/reimbursements_helper_spec.rb +1 -1
  171. data/spec/helpers/admin/store_credit_events_helper_spec.rb +1 -1
  172. data/spec/spec_helper.rb +3 -1
  173. data/spec/support/feature/base_feature_helper.rb +10 -0
  174. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  175. data/vendor/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
  176. data/vendor/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
  177. data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  178. data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  179. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
  180. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
  181. data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
  182. data/vendor/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
  183. data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
  184. data/vendor/assets/images/jquery-ui/ui-icons_666666_256x240.png +0 -0
  185. data/vendor/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
  186. data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
  187. data/vendor/assets/javascripts/jquery.powertip.js +792 -423
  188. data/vendor/assets/javascripts/jquery.sticky-kit.min.js +10 -0
  189. data/vendor/assets/javascripts/prism.js +7 -0
  190. data/vendor/assets/stylesheets/prism.css +139 -0
  191. metadata +44 -51
  192. data/app/assets/stylesheets/spree/backend/plugins/_jstree.scss +0 -135
  193. data/app/views/spree/admin/shared/_sub_menu.html.erb +0 -9
  194. data/spec/features/admin/promotions/user_rule_spec.rb +0 -25
  195. data/vendor/assets/javascripts/equalize.js +0 -41
  196. data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +0 -4540
  197. data/vendor/assets/javascripts/jquery.jstree/themes/apple/bg.jpg +0 -0
  198. data/vendor/assets/javascripts/jquery.jstree/themes/apple/d.png +0 -0
  199. data/vendor/assets/javascripts/jquery.jstree/themes/apple/dot_for_ie.gif +0 -0
  200. data/vendor/assets/javascripts/jquery.jstree/themes/apple/style.scss +0 -61
  201. data/vendor/assets/javascripts/jquery.jstree/themes/apple/throbber.gif +0 -0
  202. data/vendor/assets/javascripts/jquery.vAlign.js +0 -11
  203. data/vendor/assets/javascripts/modernizr.js +0 -4
  204. data/vendor/assets/javascripts/responsive-tables.js +0 -42
  205. data/vendor/assets/stylesheets/responsive-tables.css +0 -21
@@ -36,26 +36,6 @@ feature 'Promotion with option value rule' do
36
36
  expect(first_rule.preferred_eligible_values).to eq Hash[product.id => [option_value.id]]
37
37
  end
38
38
 
39
- context "with an attempted XSS" do
40
- let(:xss_string) { %(<script>throw("XSS")</script>) }
41
- before do
42
- option_value.update!(name: xss_string)
43
- end
44
- scenario "adding an option value rule", js: true do
45
- select2 "Option Value(s)", from: "Add rule of type"
46
- within("#rules_container") { click_button "Add" }
47
-
48
- within("#rules_container .promotion-block") do
49
- click_button "Add"
50
- end
51
-
52
- within('.promo-rule-option-value') do
53
- targetted_select2_search product.name, from: '.js-promo-rule-option-value-product-select'
54
- targetted_select2_search option_value.name, from: '.js-promo-rule-option-value-option-values-select'
55
- end
56
- end
57
- end
58
-
59
39
  context "with an existing option value rule" do
60
40
  given(:variant1) { create :variant }
61
41
  given(:variant2) { create :variant }
@@ -20,12 +20,12 @@ describe "Reports", :type => :feature do
20
20
  before do
21
21
  order = create(:order)
22
22
  order.update_columns({:adjustment_total => 100})
23
- order.completed_at = Time.now
23
+ order.completed_at = Time.current
24
24
  order.save!
25
25
 
26
26
  order = create(:order)
27
27
  order.update_columns({:adjustment_total => 200})
28
- order.completed_at = Time.now
28
+ order.completed_at = Time.current
29
29
  order.save!
30
30
 
31
31
  #incomplete order
@@ -20,7 +20,7 @@ describe 'Stock Transfers', :type => :feature, :js => true do
20
20
  fill_in 'stock_transfer_description', with: description
21
21
  click_button 'Continue'
22
22
 
23
- expect(page.find('#stock_transfer_description').value).to eq description
23
+ expect(page).to have_field('stock_transfer_description', with: description)
24
24
 
25
25
  select "NY", from: 'stock_transfer[destination_location_id]'
26
26
  within "form.edit_stock_transfer" do
@@ -77,7 +77,7 @@ describe 'Stock Transfers', :type => :feature, :js => true do
77
77
  visit spree.tracking_info_admin_stock_transfer_path(stock_transfer)
78
78
  click_link 'ship'
79
79
 
80
- first('#confirm-ship-link', visible: false).click
80
+ find('#confirm-ship-link', visible: false).click
81
81
  expect(current_path).to eq spree.admin_stock_transfers_path
82
82
  expect(stock_transfer.reload.shipped_at).to_not be_nil
83
83
  end
@@ -95,7 +95,7 @@ describe 'Stock Transfers', :type => :feature, :js => true do
95
95
 
96
96
  click_link 'ship'
97
97
 
98
- first('#confirm-ship-link', visible: false).click
98
+ find('#confirm-ship-link', visible: false).click
99
99
  expect(current_path).to eq spree.tracking_info_admin_stock_transfer_path(stock_transfer)
100
100
  expect(stock_transfer.reload.shipped_at).to be_nil
101
101
  end
@@ -24,7 +24,7 @@ describe "Store credits admin" do
24
24
  expect(page.current_path).to eq spree.admin_user_store_credits_path(store_credit.user)
25
25
 
26
26
  store_credit_table = page.find(".twelve.columns > table")
27
- expect(store_credit_table.all('tr').count).to eq 1
27
+ expect(store_credit_table).to have_css('tr', count: 1)
28
28
  expect(store_credit_table).to have_content(Spree::Money.new(store_credit.amount).to_s)
29
29
  expect(store_credit_table).to have_content(Spree::Money.new(store_credit.amount_used).to_s)
30
30
  expect(store_credit_table).to have_content(store_credit.category_name)
@@ -49,7 +49,7 @@ describe "Store credits admin" do
49
49
 
50
50
  expect(page.current_path).to eq spree.admin_user_store_credits_path(store_credit.user)
51
51
  store_credit_table = page.find(".twelve.columns > table")
52
- expect(store_credit_table.all('tr').count).to eq 2
52
+ expect(store_credit_table).to have_css('tr', count: 2)
53
53
  expect(Spree::StoreCredit.count).to eq 2
54
54
  end
55
55
  end
@@ -3,8 +3,8 @@ require 'spec_helper'
3
3
  describe 'Users', :type => :feature do
4
4
  stub_authorization!
5
5
  let!(:country) { create(:country) }
6
- let!(:user_a) { create(:user_with_addreses, email: 'a@example.com') }
7
- let!(:user_b) { create(:user_with_addreses, email: 'b@example.com') }
6
+ let!(:user_a) { create(:user_with_addresses, email: 'a@example.com') }
7
+ let!(:user_b) { create(:user_with_addresses, email: 'b@example.com') }
8
8
 
9
9
  let(:order) { create(:completed_order_with_totals, user: user_a, number: "R123") }
10
10
 
@@ -108,7 +108,7 @@ describe 'Users', :type => :feature do
108
108
 
109
109
  expect(user_a.reload.email).to eq 'a@example.com99'
110
110
  expect(page).to have_text 'Account updated'
111
- expect(find_field('user_email').value).to eq 'a@example.com99'
111
+ expect(page).to have_field('user_email', with: 'a@example.com99')
112
112
  end
113
113
 
114
114
  it 'can edit the user password' do
@@ -126,7 +126,7 @@ describe 'Users', :type => :feature do
126
126
  check 'user_spree_role_admin'
127
127
  click_button 'Update'
128
128
  expect(page).to have_text 'Account updated'
129
- expect(find_field('user_spree_role_admin')['checked']).to be true
129
+ expect(find_field('user_spree_role_admin')).to be_checked
130
130
  end
131
131
 
132
132
  it 'can edit user shipping address' do
@@ -135,7 +135,7 @@ describe 'Users', :type => :feature do
135
135
  within("#admin_user_edit_addresses") do
136
136
  fill_in "user_ship_address_attributes_address1", with: "1313 Mockingbird Ln"
137
137
  click_button 'Update'
138
- expect(find_field('user_ship_address_attributes_address1').value).to eq "1313 Mockingbird Ln"
138
+ expect(page).to have_field('user_ship_address_attributes_address1', with: "1313 Mockingbird Ln")
139
139
  end
140
140
 
141
141
  expect(user_a.reload.ship_address.address1).to eq "1313 Mockingbird Ln"
@@ -147,7 +147,7 @@ describe 'Users', :type => :feature do
147
147
  within("#admin_user_edit_addresses") do
148
148
  fill_in "user_bill_address_attributes_address1", with: "1313 Mockingbird Ln"
149
149
  click_button 'Update'
150
- expect(find_field('user_bill_address_attributes_address1').value).to eq "1313 Mockingbird Ln"
150
+ expect(page).to have_field('user_bill_address_attributes_address1', with: "1313 Mockingbird Ln")
151
151
  end
152
152
 
153
153
  expect(user_a.reload.bill_address.address1).to eq "1313 Mockingbird Ln"
@@ -69,5 +69,10 @@ describe Spree::Admin::NavigationHelper, :type => :helper do
69
69
  end
70
70
  end
71
71
  end
72
+
73
+ it "should accept a block of content to append" do
74
+ admin_tab = helper.tab(:orders){ 'foo' }
75
+ expect(admin_tab).to end_with("foo</li>")
76
+ end
72
77
  end
73
78
  end
@@ -27,7 +27,7 @@ describe Spree::Admin::ReimbursementsHelper, type: :helper do
27
27
  let(:status) { 'noop' }
28
28
 
29
29
  it 'should raise an error' do
30
- expect{ subject }.to raise_error(RuntimeError)
30
+ expect{ subject }.to raise_error(RuntimeError, "unknown reimbursement status: noop")
31
31
  end
32
32
  end
33
33
  end
@@ -88,7 +88,7 @@ describe Spree::Admin::StoreCreditEventsHelper, type: :helper do
88
88
  let(:originator) { create(:store_credit_update_reason) }
89
89
 
90
90
  it "raises an error" do
91
- expect { subject }.to raise_error(RuntimeError)
91
+ expect { subject }.to raise_error(RuntimeError, "Unexpected originator type Spree::StoreCreditUpdateReason")
92
92
  end
93
93
  end
94
94
  end
data/spec/spec_helper.rb CHANGED
@@ -64,7 +64,6 @@ RSpec.configure do |config|
64
64
  config.use_transactional_fixtures = false
65
65
 
66
66
  config.before :suite do
67
- Capybara.match = :prefer_exact
68
67
  DatabaseCleaner.clean_with :truncation
69
68
  end
70
69
 
@@ -73,6 +72,7 @@ RSpec.configure do |config|
73
72
  reset_spree_preferences
74
73
  WebMock.disable!
75
74
  if RSpec.current_example.metadata[:js]
75
+ page.driver.browser.url_blacklist = ['http://fonts.googleapis.com']
76
76
  DatabaseCleaner.strategy = :truncation
77
77
  else
78
78
  DatabaseCleaner.strategy = :transaction
@@ -87,6 +87,8 @@ RSpec.configure do |config|
87
87
  DatabaseCleaner.clean
88
88
  end
89
89
 
90
+ config.include BaseFeatureHelper, :type => :feature
91
+
90
92
  config.after(:each, :type => :feature) do |example|
91
93
  missing_translations = page.body.scan(/translation missing: #{I18n.locale}\.(.*?)[\s<\"&]/)
92
94
  if missing_translations.any?
@@ -0,0 +1,10 @@
1
+ module BaseFeatureHelper
2
+ def click_nav(nav_text, subnav_text=nil)
3
+ primary_nav = find(".admin-nav-menu>ul>li>a", text: %r{#{nav_text}}i)
4
+ if subnav_text
5
+ primary_nav.find('+ul>li>a', text: %r{#{subnav_text}}i).click
6
+ else
7
+ primary_nav.click
8
+ end
9
+ end
10
+ end