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.
- checksums.yaml +4 -4
- data/app/assets/images/solidus-style-guide-logo.png +0 -0
- data/app/assets/javascripts/spree/backend/admin.js.erb +1 -7
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +2 -2
- data/app/assets/javascripts/spree/backend/navigation.coffee +10 -0
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/option_value_picker.js +6 -6
- data/app/assets/javascripts/spree/backend/product_picker.js +6 -6
- data/app/assets/javascripts/spree/backend/shipments.js.erb +17 -3
- data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +2 -2
- data/app/assets/javascripts/spree/backend/style_guide.coffee +2 -0
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +82 -109
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +4 -5
- data/app/assets/javascripts/spree/backend/user_picker.js +8 -8
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee.erb +3 -3
- data/app/assets/javascripts/spree/backend.js +3 -6
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +1 -4
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +99 -115
- data/app/assets/stylesheets/spree/backend/components/_progress.scss +1 -1
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +6 -0
- data/app/assets/stylesheets/spree/backend/globals/_variables.scss +18 -0
- data/app/assets/stylesheets/spree/backend/globals/mixins/_caret.scss +35 -0
- data/app/assets/stylesheets/spree/backend/plugins/_powertip.scss +1 -0
- data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +132 -0
- data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +60 -0
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +2 -0
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +36 -4
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +3 -6
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +4 -1
- data/app/assets/stylesheets/spree/backend.css +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +6 -6
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/payments_controller.rb +1 -1
- data/app/controllers/spree/admin/products_controller.rb +0 -1
- data/app/controllers/spree/admin/reports_controller.rb +2 -2
- data/app/controllers/spree/admin/search_controller.rb +9 -7
- data/app/controllers/spree/admin/stock_transfers_controller.rb +6 -14
- data/app/controllers/spree/admin/style_guide_controller.rb +33 -0
- data/app/helpers/spree/admin/adjustments_helper.rb +2 -6
- data/app/helpers/spree/admin/base_helper.rb +7 -6
- data/app/helpers/spree/admin/navigation_helper.rb +12 -5
- data/app/helpers/spree/admin/orders_helper.rb +1 -1
- data/app/helpers/spree/admin/products_helper.rb +2 -4
- data/app/helpers/spree/admin/stock_movements_helper.rb +3 -3
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/edit.html.erb +1 -1
- data/app/views/spree/admin/images/edit.html.erb +1 -3
- data/app/views/spree/admin/images/index.html.erb +0 -2
- data/app/views/spree/admin/option_types/edit.html.erb +2 -4
- data/app/views/spree/admin/option_types/index.html.erb +0 -2
- data/app/views/spree/admin/option_types/new.html.erb +0 -2
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +1 -1
- data/app/views/spree/admin/product_properties/index.html.erb +0 -1
- data/app/views/spree/admin/products/edit.html.erb +0 -2
- data/app/views/spree/admin/products/index.html.erb +2 -4
- data/app/views/spree/admin/products/new.html.erb +0 -2
- data/app/views/spree/admin/promotion_categories/edit.html.erb +0 -2
- data/app/views/spree/admin/promotion_categories/index.html.erb +0 -2
- data/app/views/spree/admin/promotion_categories/new.html.erb +0 -2
- data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +2 -28
- data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +2 -26
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +28 -0
- data/app/views/spree/admin/promotions/edit.html.erb +0 -2
- data/app/views/spree/admin/promotions/index.html.erb +0 -2
- data/app/views/spree/admin/promotions/new.html.erb +0 -2
- data/app/views/spree/admin/properties/edit.html.erb +0 -2
- data/app/views/spree/admin/properties/index.html.erb +2 -4
- data/app/views/spree/admin/properties/new.html.erb +0 -2
- data/app/views/spree/admin/properties/new.js.erb +1 -1
- data/app/views/spree/admin/prototypes/edit.html.erb +0 -2
- data/app/views/spree/admin/prototypes/index.html.erb +0 -2
- data/app/views/spree/admin/prototypes/new.html.erb +0 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/show.html.erb +9 -9
- data/app/views/spree/admin/return_authorizations/_form.html.erb +16 -16
- data/app/views/spree/admin/search/users.rabl +1 -1
- data/app/views/spree/admin/shared/_head.html.erb +11 -0
- data/app/views/spree/admin/shared/_header.html.erb +4 -8
- data/app/views/spree/admin/shared/_menu.html.erb +4 -8
- data/app/views/spree/admin/shared/_navigation.html.erb +9 -0
- data/app/views/spree/admin/shared/_navigation_footer.html.erb +3 -0
- data/app/views/spree/admin/shared/_product_sub_menu.html.erb +20 -22
- data/app/views/spree/admin/shared/_promotion_sub_menu.html.erb +8 -10
- data/app/views/spree/admin/shared/_stock_sub_menu.html.erb +8 -10
- data/app/views/spree/admin/shared/_tabs.html.erb +9 -3
- data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
- data/app/views/spree/admin/stock_items/index.html.erb +1 -2
- data/app/views/spree/admin/stock_transfers/edit.html.erb +0 -1
- data/app/views/spree/admin/stock_transfers/index.html.erb +0 -3
- data/app/views/spree/admin/stock_transfers/new.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/receive.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/show.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/tracking_info.html.erb +0 -2
- data/app/views/spree/admin/style_guide/index.html.erb +5 -0
- data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +79 -0
- data/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb +14 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +13 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_loading.html.erb +20 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_tooltips.html.erb +16 -0
- data/app/views/spree/admin/style_guide/topics/tables/_building_tables.html.erb +44 -0
- data/app/views/spree/admin/style_guide/topics/tables/_pagination.html.erb +11 -0
- data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +64 -0
- data/app/views/spree/admin/style_guide/topics/typography/_fonts.html.erb +19 -0
- data/app/views/spree/admin/style_guide/topics/typography/_icons.html.erb +13 -0
- data/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +25 -0
- data/app/views/spree/admin/style_guide/topics/typography/_tags.html.erb +25 -0
- data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -0
- data/app/views/spree/admin/taxonomies/edit.erb +5 -6
- data/app/views/spree/admin/taxonomies/index.html.erb +0 -2
- data/app/views/spree/admin/taxonomies/new.html.erb +0 -2
- data/app/views/spree/admin/taxons/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_list_template.html.erb +17 -0
- data/app/views/spree/admin/taxons/index.html.erb +0 -3
- data/app/views/spree/admin/users/orders.html.erb +1 -1
- data/app/views/spree/admin/variants/edit.html.erb +0 -2
- data/app/views/spree/admin/variants/index.html.erb +0 -2
- data/app/views/spree/layouts/admin.html.erb +3 -4
- data/app/views/spree/layouts/admin_style_guide.html.erb +58 -0
- data/config/routes.rb +4 -2
- data/lib/spree/backend/engine.rb +0 -1
- data/lib/spree/backend.rb +0 -3
- data/solidus_backend.gemspec +5 -7
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/orders_controller_spec.rb +14 -14
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -4
- data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/products_controller_spec.rb +3 -3
- data/spec/controllers/spree/admin/reports_controller_spec.rb +4 -4
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +13 -11
- data/spec/features/admin/configuration/general_settings_spec.rb +10 -7
- data/spec/features/admin/configuration/payment_methods_spec.rb +1 -1
- data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
- data/spec/features/admin/configuration/states_spec.rb +1 -1
- data/spec/features/admin/configuration/tax_rates_spec.rb +6 -7
- data/spec/features/admin/configuration/taxonomies_spec.rb +3 -3
- data/spec/features/admin/homepage_spec.rb +6 -6
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +4 -8
- data/spec/features/admin/orders/customer_details_spec.rb +9 -8
- data/spec/features/admin/orders/line_items_spec.rb +1 -1
- data/spec/features/admin/orders/listing_spec.rb +2 -2
- data/spec/features/admin/orders/log_entries_spec.rb +3 -3
- data/spec/features/admin/orders/new_order_spec.rb +3 -15
- data/spec/features/admin/orders/order_details_spec.rb +17 -20
- data/spec/features/admin/orders/payments_spec.rb +10 -10
- data/spec/features/admin/orders/shipments_spec.rb +2 -2
- data/spec/features/admin/products/edit/images_spec.rb +5 -3
- data/spec/features/admin/products/edit/products_spec.rb +11 -11
- data/spec/features/admin/products/edit/taxons_spec.rb +14 -38
- data/spec/features/admin/products/edit/variants_spec.rb +3 -3
- data/spec/features/admin/products/option_types_spec.rb +22 -21
- data/spec/features/admin/products/products_spec.rb +15 -12
- data/spec/features/admin/products/properties_spec.rb +3 -3
- data/spec/features/admin/products/prototypes_spec.rb +4 -4
- data/spec/features/admin/products/stock_management_spec.rb +5 -5
- data/spec/features/admin/products/variant_spec.rb +8 -8
- data/spec/features/admin/promotion_adjustments_spec.rb +6 -13
- data/spec/features/admin/promotions/option_value_rule_spec.rb +0 -20
- data/spec/features/admin/reports_spec.rb +2 -2
- data/spec/features/admin/stock_transfer_spec.rb +3 -3
- data/spec/features/admin/store_credits_spec.rb +2 -2
- data/spec/features/admin/users_spec.rb +6 -6
- data/spec/helpers/admin/navigation_helper_spec.rb +5 -0
- data/spec/helpers/admin/reimbursements_helper_spec.rb +1 -1
- data/spec/helpers/admin/store_credit_events_helper_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/support/feature/base_feature_helper.rb +10 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_666666_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/javascripts/jquery.powertip.js +792 -423
- data/vendor/assets/javascripts/jquery.sticky-kit.min.js +10 -0
- data/vendor/assets/javascripts/prism.js +7 -0
- data/vendor/assets/stylesheets/prism.css +139 -0
- metadata +44 -51
- data/app/assets/stylesheets/spree/backend/plugins/_jstree.scss +0 -135
- data/app/views/spree/admin/shared/_sub_menu.html.erb +0 -9
- data/spec/features/admin/promotions/user_rule_spec.rb +0 -25
- data/vendor/assets/javascripts/equalize.js +0 -41
- data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +0 -4540
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/bg.jpg +0 -0
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/d.png +0 -0
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/dot_for_ie.gif +0 -0
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/style.scss +0 -61
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/throbber.gif +0 -0
- data/vendor/assets/javascripts/jquery.vAlign.js +0 -11
- data/vendor/assets/javascripts/modernizr.js +0 -4
- data/vendor/assets/javascripts/responsive-tables.js +0 -42
- data/vendor/assets/stylesheets/responsive-tables.css +0 -21
@@ -30,7 +30,7 @@ describe 'Payments', :type => :feature do
|
|
30
30
|
visit current_path
|
31
31
|
end
|
32
32
|
|
33
|
-
# Regression tests for
|
33
|
+
# Regression tests for https://github.com/spree/spree/issues/1453
|
34
34
|
context 'with a check payment' do
|
35
35
|
let(:order) { create(:completed_order_with_totals, number: 'R100') }
|
36
36
|
let!(:payment) do
|
@@ -80,7 +80,7 @@ describe 'Payments', :type => :feature do
|
|
80
80
|
end
|
81
81
|
|
82
82
|
click_icon :void
|
83
|
-
expect(
|
83
|
+
expect(page).to have_css('#payment_status', text: 'BALANCE DUE')
|
84
84
|
expect(page).to have_content('Payment Updated')
|
85
85
|
|
86
86
|
within_row(1) do
|
@@ -95,12 +95,12 @@ describe 'Payments', :type => :feature do
|
|
95
95
|
expect(page).to have_content('successfully created!')
|
96
96
|
|
97
97
|
click_icon(:capture)
|
98
|
-
expect(find('#payment_status').text).to eq('PAID')
|
99
98
|
|
99
|
+
expect(page).to have_selector('#payment_status', text: 'PAID')
|
100
100
|
expect(page).not_to have_selector('#new_payment_section')
|
101
101
|
end
|
102
102
|
|
103
|
-
# Regression test for
|
103
|
+
# Regression test for https://github.com/spree/spree/issues/1269
|
104
104
|
it 'cannot create a payment for an order with no payment methods' do
|
105
105
|
Spree::PaymentMethod.delete_all
|
106
106
|
order.payments.delete_all
|
@@ -150,10 +150,10 @@ describe 'Payments', :type => :feature do
|
|
150
150
|
within_row(1) do
|
151
151
|
click_icon(:edit)
|
152
152
|
fill_in('amount', with: 'invalid')
|
153
|
-
expect(find('td.amount input').value).to eq('invalid')
|
154
|
-
expect(payment.reload.amount).to eq(150.00)
|
155
153
|
end
|
156
154
|
expect(page).to have_selector('.flash.error', text: 'Invalid resource. Please fix errors and try again.')
|
155
|
+
expect(page).to have_field('amount', with: 'invalid')
|
156
|
+
expect(payment.reload.amount).to eq(150.00)
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
@@ -173,7 +173,7 @@ describe 'Payments', :type => :feature do
|
|
173
173
|
let(:order) { create(:order_with_line_items, :line_items_count => 1) }
|
174
174
|
let!(:payment_method) { create(:credit_card_payment_method)}
|
175
175
|
|
176
|
-
# Regression tests for
|
176
|
+
# Regression tests for https://github.com/spree/spree/issues/4129
|
177
177
|
context "with a credit card payment method" do
|
178
178
|
before do
|
179
179
|
visit spree.admin_order_payments_path(order)
|
@@ -181,10 +181,10 @@ describe 'Payments', :type => :feature do
|
|
181
181
|
|
182
182
|
it "is able to create a new credit card payment with valid information", :js => true do
|
183
183
|
fill_in "Card Number", :with => "4111 1111 1111 1111"
|
184
|
-
fill_in "Name", :with => "Test User"
|
185
|
-
fill_in "Expiration", :with => "09 / #{Time.
|
184
|
+
fill_in "Name *", :with => "Test User"
|
185
|
+
fill_in "Expiration", :with => "09 / #{Time.current.year + 1}"
|
186
186
|
fill_in "Card Code", :with => "007"
|
187
|
-
# Regression test for
|
187
|
+
# Regression test for https://github.com/spree/spree/issues/4277
|
188
188
|
expect(page).to have_css('.ccType[value="visa"]', visible: false)
|
189
189
|
click_button "Continue"
|
190
190
|
expect(page).to have_content("Payment has been successfully created!")
|
@@ -5,7 +5,7 @@ describe "Shipments", :type => :feature do
|
|
5
5
|
|
6
6
|
let!(:order) { create(:order_ready_to_ship, :number => "R100", :state => "complete", :line_items_count => 5) }
|
7
7
|
|
8
|
-
# Regression test for
|
8
|
+
# Regression test for https://github.com/spree/spree/issues/4025
|
9
9
|
context "a shipment without a shipping method" do
|
10
10
|
before do
|
11
11
|
order.shipments.each do |s|
|
@@ -15,7 +15,7 @@ describe "Shipments", :type => :feature do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
it "can still be displayed" do
|
18
|
-
|
18
|
+
visit spree.edit_admin_order_path(order)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -19,7 +19,7 @@ describe "Product Images", :type => :feature do
|
|
19
19
|
create(:product)
|
20
20
|
|
21
21
|
visit spree.admin_path
|
22
|
-
|
22
|
+
click_nav "Products"
|
23
23
|
click_icon(:edit)
|
24
24
|
click_link "Images"
|
25
25
|
click_link "new_image_link"
|
@@ -27,7 +27,9 @@ describe "Product Images", :type => :feature do
|
|
27
27
|
click_button "Update"
|
28
28
|
expect(page).to have_content("successfully created!")
|
29
29
|
|
30
|
-
|
30
|
+
within_row(1) do
|
31
|
+
click_icon(:edit)
|
32
|
+
end
|
31
33
|
fill_in "image_alt", :with => "ruby on rails t-shirt"
|
32
34
|
click_button "Update"
|
33
35
|
expect(page).to have_content("successfully updated!")
|
@@ -40,7 +42,7 @@ describe "Product Images", :type => :feature do
|
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
43
|
-
# Regression test for
|
45
|
+
# Regression test for https://github.com/spree/spree/issues/2228
|
44
46
|
it "should see variant images" do
|
45
47
|
variant = create(:variant)
|
46
48
|
variant.images.create!(:attachment => File.open(file_path))
|
@@ -10,19 +10,19 @@ describe 'Product Details', :type => :feature do
|
|
10
10
|
:description => 'lorem ipsum', :available_on => '2013-08-14 01:02:03')
|
11
11
|
|
12
12
|
visit spree.admin_path
|
13
|
-
|
13
|
+
click_nav "Products"
|
14
14
|
within_row(1) { click_icon :edit }
|
15
15
|
|
16
16
|
click_link 'Product Details'
|
17
17
|
|
18
|
-
expect(
|
19
|
-
expect(
|
20
|
-
expect(
|
21
|
-
expect(
|
22
|
-
expect(
|
23
|
-
expect(
|
24
|
-
expect(
|
25
|
-
expect(
|
18
|
+
expect(page).to have_css('.page-title', text: 'Editing Product “Bún thịt nướng”')
|
19
|
+
expect(page).to have_field('product_name', with: 'Bún thịt nướng')
|
20
|
+
expect(page).to have_field('product_slug', with: 'bun-th-t-n-ng')
|
21
|
+
expect(page).to have_field('product_description', with: 'lorem ipsum')
|
22
|
+
expect(page).to have_field('product_price', with: '19.99')
|
23
|
+
expect(page).to have_field('product_cost_price', with: '17.00')
|
24
|
+
expect(page).to have_field('product_available_on', with: "2013/08/14")
|
25
|
+
expect(page).to have_field('product_sku', with: 'A100')
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should handle slug changes" do
|
@@ -30,7 +30,7 @@ describe 'Product Details', :type => :feature do
|
|
30
30
|
:description => 'lorem ipsum', :available_on => '2011-01-01 01:01:01')
|
31
31
|
|
32
32
|
visit spree.admin_path
|
33
|
-
|
33
|
+
click_nav "Products"
|
34
34
|
within('table.index tbody tr:nth-child(1)') do
|
35
35
|
click_icon(:edit)
|
36
36
|
end
|
@@ -49,7 +49,7 @@ describe 'Product Details', :type => :feature do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
# Regression test for
|
52
|
+
# Regression test for https://github.com/spree/spree/issues/3385
|
53
53
|
context "deleting a product", :js => true do
|
54
54
|
it "is still able to find the master variant" do
|
55
55
|
create(:product)
|
@@ -3,54 +3,30 @@ require 'spec_helper'
|
|
3
3
|
describe "Product Taxons", :type => :feature do
|
4
4
|
stub_authorization!
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
6
|
+
context "managing taxons" do
|
7
|
+
def assert_selected_taxons(taxons)
|
8
|
+
# Regression test for https://github.com/spree/spree/issues/2139
|
9
|
+
taxons.each do |taxon|
|
10
|
+
expect(page).to have_css(".select2-search-choice", text: taxon.name)
|
11
|
+
end
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
find("#product_taxon_ids").value.split(',').map(&:to_i).uniq
|
13
|
+
expected_value = taxons.map(&:id).join(",")
|
14
|
+
expect(page).to have_xpath("//*[@id = 'product_taxon_ids' and @value = '#{expected_value}']", visible: :all)
|
17
15
|
end
|
18
16
|
|
19
|
-
|
20
|
-
|
21
|
-
it "should allow an admin to manage taxons" do
|
17
|
+
it "should allow an admin to manage taxons", :js => true do
|
22
18
|
taxon_1 = create(:taxon)
|
23
|
-
taxon_2 = create(:taxon, name
|
19
|
+
taxon_2 = create(:taxon, :name => 'Clothing')
|
20
|
+
product = create(:product)
|
24
21
|
product.taxons << taxon_1
|
25
22
|
|
26
|
-
visit spree.
|
27
|
-
click_link "Products"
|
28
|
-
within("table.index") do
|
29
|
-
click_icon :edit
|
30
|
-
end
|
23
|
+
visit spree.edit_admin_product_path(product)
|
31
24
|
|
32
|
-
|
33
|
-
expect(selected_taxons).to match_array([taxon_1.id])
|
25
|
+
assert_selected_taxons([taxon_1])
|
34
26
|
|
35
27
|
select2_search "Clothing", :from => "Taxons"
|
36
28
|
click_button "Update"
|
37
|
-
|
38
|
-
|
39
|
-
# Regression test for #2139
|
40
|
-
expect(page).to have_css(".select2-search-choice", text: taxon_1.name)
|
41
|
-
expect(page).to have_css(".select2-search-choice", text: taxon_2.name)
|
42
|
-
end
|
43
|
-
|
44
|
-
context "with an XSS attempt" do
|
45
|
-
let(:taxon_name) { %(<script>throw("XSS")</script>) }
|
46
|
-
let!(:taxon) { create(:taxon, name: taxon_name) }
|
47
|
-
it "displays the escaped HTML without executing it" do
|
48
|
-
visit spree.edit_admin_product_path(product)
|
49
|
-
|
50
|
-
select2_search "<script>", from: "Taxons"
|
51
|
-
|
52
|
-
expect(page).to have_content(taxon_name)
|
53
|
-
end
|
29
|
+
assert_selected_taxons([taxon_1, taxon_2])
|
54
30
|
end
|
55
31
|
end
|
56
32
|
end
|
@@ -11,7 +11,7 @@ describe "Product Variants", :type => :feature do
|
|
11
11
|
let!(:product) { create(:product) }
|
12
12
|
|
13
13
|
it "should allow an admin to create option types for a variant" do
|
14
|
-
|
14
|
+
click_nav "Products"
|
15
15
|
|
16
16
|
within_row(1) { click_icon :edit }
|
17
17
|
|
@@ -20,7 +20,7 @@ describe "Product Variants", :type => :feature do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "allows admin to create a variant if there are option types" do
|
23
|
-
|
23
|
+
click_nav "Products"
|
24
24
|
click_link "Option Types"
|
25
25
|
click_link "new_option_type_link"
|
26
26
|
fill_in "option_type_name", :with => "shirt colors"
|
@@ -34,7 +34,7 @@ describe "Product Variants", :type => :feature do
|
|
34
34
|
expect(page).to have_content("successfully updated!")
|
35
35
|
|
36
36
|
visit spree.admin_path
|
37
|
-
|
37
|
+
click_nav "Products"
|
38
38
|
within('table.index tbody tr:nth-child(1)') do
|
39
39
|
click_icon :edit
|
40
40
|
end
|
@@ -5,7 +5,7 @@ describe "Option Types", :type => :feature do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
visit spree.admin_path
|
8
|
-
|
8
|
+
click_nav "Products"
|
9
9
|
end
|
10
10
|
|
11
11
|
context "listing option types" do
|
@@ -46,7 +46,9 @@ describe "Option Types", :type => :feature do
|
|
46
46
|
create(:option_type, :name => "tshirt-color", :presentation => "Color")
|
47
47
|
create(:option_type, :name => "tshirt-size", :presentation => "Size")
|
48
48
|
click_link "Option Types"
|
49
|
-
within('table#listing_option_types')
|
49
|
+
within('table#listing_option_types') do
|
50
|
+
find('tr', text: 'Size').click_link "Edit"
|
51
|
+
end
|
50
52
|
fill_in "option_type_name", :with => "foo-size 99"
|
51
53
|
click_button "Update"
|
52
54
|
expect(page).to have_content("successfully updated!")
|
@@ -54,18 +56,21 @@ describe "Option Types", :type => :feature do
|
|
54
56
|
end
|
55
57
|
end
|
56
58
|
|
57
|
-
# Regression test for
|
59
|
+
# Regression test for https://github.com/spree/spree/issues/2277
|
58
60
|
it "can remove an option value from an option type", :js => true do
|
59
61
|
create(:option_value)
|
60
62
|
click_link "Option Types"
|
61
63
|
within('table#listing_option_types') { click_icon :edit }
|
62
64
|
expect(page).to have_content("Editing Option Type")
|
63
|
-
expect(
|
65
|
+
expect(page).to have_css("tbody#option_values tr", count: 1)
|
64
66
|
within("tbody#option_values") do
|
65
67
|
find('.spree_remove_fields').click
|
66
68
|
end
|
67
69
|
# Assert that the field is hidden automatically
|
68
|
-
expect(
|
70
|
+
expect(page).to have_no_css("tbody#option_values tr")
|
71
|
+
|
72
|
+
# Ensure the DELETE request finishes
|
73
|
+
expect(page).to have_no_css("#progress")
|
69
74
|
|
70
75
|
# Then assert that on a page refresh that it's still not visible
|
71
76
|
visit page.current_url
|
@@ -73,42 +78,38 @@ describe "Option Types", :type => :feature do
|
|
73
78
|
# Sometimes the page doesn't load before the all check is done
|
74
79
|
# lazily finding the element gives the page 10 seconds
|
75
80
|
expect(page).to have_css("tbody#option_values")
|
76
|
-
all("tbody#option_values tr input").
|
81
|
+
all("tbody#option_values tr input", count: 2).each do |input|
|
82
|
+
expect(input.value).to be_blank
|
83
|
+
end
|
77
84
|
end
|
78
|
-
|
79
|
-
# Regression test for
|
85
|
+
|
86
|
+
# Regression test for https://github.com/spree/spree/issues/3204
|
80
87
|
it "can remove a non-persisted option value from an option type", :js => true do
|
81
88
|
create(:option_type)
|
82
89
|
click_link "Option Types"
|
83
90
|
within('table#listing_option_types') { click_icon :edit }
|
84
91
|
|
85
|
-
|
86
|
-
page.find("tbody#option_values", :visible => true)
|
87
|
-
|
88
|
-
expect(all("tbody#option_values tr").select(&:visible?).count).to eq(1)
|
92
|
+
expect(page).to have_css("tbody#option_values tr", count: 1)
|
89
93
|
|
90
94
|
# Add a new option type
|
91
95
|
click_link "Add Option Value"
|
92
|
-
expect(
|
96
|
+
expect(page).to have_css("tbody#option_values tr", count: 2)
|
93
97
|
|
94
98
|
# Remove default option type
|
95
99
|
within("tbody#option_values") do
|
96
|
-
|
100
|
+
within_row(1) do
|
101
|
+
find('.fa-trash').click
|
102
|
+
end
|
97
103
|
end
|
98
|
-
# Check that there was no HTTP request
|
99
|
-
expect(all("div#progress[style]").count).to eq(0)
|
100
104
|
# Assert that the field is hidden automatically
|
101
|
-
expect(
|
105
|
+
expect(page).to have_css("tbody#option_values tr", count: 1)
|
102
106
|
|
103
107
|
# Remove added option type
|
104
108
|
within("tbody#option_values") do
|
105
109
|
find('.fa-trash').click
|
106
110
|
end
|
107
|
-
# Check that there was no HTTP request
|
108
|
-
expect(all("div#progress[style]").count).to eq(0)
|
109
111
|
# Assert that the field is hidden automatically
|
110
|
-
expect(
|
111
|
-
|
112
|
+
expect(page).to have_css("tbody#option_values tr", count: 0)
|
112
113
|
end
|
113
114
|
|
114
115
|
end
|
@@ -25,7 +25,7 @@ describe "Products", :type => :feature do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should list existing products with correct sorting by name" do
|
28
|
-
|
28
|
+
click_nav "Products"
|
29
29
|
# Name ASC
|
30
30
|
within_row(1) { expect(page).to have_content('apache baseball cap') }
|
31
31
|
within_row(2) { expect(page).to have_content("zomg shirt") }
|
@@ -37,7 +37,7 @@ describe "Products", :type => :feature do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should list existing products with correct sorting by price" do
|
40
|
-
|
40
|
+
click_nav "Products"
|
41
41
|
|
42
42
|
# Name ASC (default)
|
43
43
|
within_row(1) { expect(page).to have_content('apache baseball cap') }
|
@@ -60,7 +60,7 @@ describe "Products", :type => :feature do
|
|
60
60
|
create(:product, :name => "Just a product", :price => 19.99)
|
61
61
|
end
|
62
62
|
|
63
|
-
# Regression test for
|
63
|
+
# Regression test for https://github.com/spree/spree/issues/2737
|
64
64
|
context "uses руб as the currency symbol" do
|
65
65
|
it "on the products listing page" do
|
66
66
|
visit spree.admin_products_path
|
@@ -76,7 +76,7 @@ describe "Products", :type => :feature do
|
|
76
76
|
create(:product, :name => 'apache baseball cap', :deleted_at => "2011-01-06 18:21:13")
|
77
77
|
create(:product, :name => 'zomg shirt')
|
78
78
|
|
79
|
-
|
79
|
+
click_nav "Products"
|
80
80
|
expect(page).to have_content("zomg shirt")
|
81
81
|
expect(page).not_to have_content("apache baseball cap")
|
82
82
|
check "Show Deleted"
|
@@ -94,7 +94,7 @@ describe "Products", :type => :feature do
|
|
94
94
|
create(:product, :name => 'apache baseball cap2', :sku => "B100")
|
95
95
|
create(:product, :name => 'zomg shirt')
|
96
96
|
|
97
|
-
|
97
|
+
click_nav "Products"
|
98
98
|
fill_in "q_name_cont", :with => "ap"
|
99
99
|
click_icon :search
|
100
100
|
expect(page).to have_content("apache baseball cap")
|
@@ -141,7 +141,7 @@ describe "Products", :type => :feature do
|
|
141
141
|
@option_type_prototype = prototype
|
142
142
|
@property_prototype = create(:prototype, :name => "Random")
|
143
143
|
@shipping_category = create(:shipping_category)
|
144
|
-
|
144
|
+
click_nav "Products"
|
145
145
|
click_link "admin_new_product"
|
146
146
|
within('#new_product') do
|
147
147
|
expect(page).to have_content("SKU")
|
@@ -186,7 +186,7 @@ describe "Products", :type => :feature do
|
|
186
186
|
context "creating a new product" do
|
187
187
|
before(:each) do
|
188
188
|
@shipping_category = create(:shipping_category)
|
189
|
-
|
189
|
+
click_nav "Products"
|
190
190
|
click_link "admin_new_product"
|
191
191
|
within('#new_product') do
|
192
192
|
expect(page).to have_content("SKU")
|
@@ -241,13 +241,16 @@ describe "Products", :type => :feature do
|
|
241
241
|
end
|
242
242
|
|
243
243
|
it "should show localized price value on validation errors", :js => true do
|
244
|
+
fill_in "Name", :with => " "
|
245
|
+
select @shipping_category.name, from: "product_shipping_category_id"
|
244
246
|
fill_in "product_price", :with => "19,99"
|
245
247
|
click_button "Create"
|
246
|
-
expect(
|
248
|
+
expect(page).to have_content("Name can't be blank")
|
249
|
+
expect(page).to have_field('product_price', with: '19,99')
|
247
250
|
end
|
248
251
|
end
|
249
252
|
|
250
|
-
# Regression test for
|
253
|
+
# Regression test for https://github.com/spree/spree/issues/2097
|
251
254
|
it "can set the count on hand to a null value", :js => true do
|
252
255
|
fill_in "product_name", :with => "Baseball Cap"
|
253
256
|
fill_in "product_price", :with => "100"
|
@@ -264,7 +267,7 @@ describe "Products", :type => :feature do
|
|
264
267
|
it "should allow an admin to clone a product" do
|
265
268
|
create(:product)
|
266
269
|
|
267
|
-
|
270
|
+
click_nav "Products"
|
268
271
|
within_row(1) do
|
269
272
|
click_icon :copy
|
270
273
|
end
|
@@ -276,7 +279,7 @@ describe "Products", :type => :feature do
|
|
276
279
|
it "should allow an admin to clone a deleted product" do
|
277
280
|
create(:product, :name => "apache baseball cap")
|
278
281
|
|
279
|
-
|
282
|
+
click_nav "Products"
|
280
283
|
check "Show Deleted"
|
281
284
|
click_button "Search"
|
282
285
|
|
@@ -327,7 +330,7 @@ describe "Products", :type => :feature do
|
|
327
330
|
# inspect the first one.
|
328
331
|
expect(page).to have_css('#product_properties .product_property', count: 2)
|
329
332
|
within('#product_properties .product_property:nth-child(1)') do
|
330
|
-
expect(find('input[type=text]').value).to eq('baseball_cap_color')
|
333
|
+
expect(find('input[type=text]', match: :first).value).to eq('baseball_cap_color')
|
331
334
|
end
|
332
335
|
end
|
333
336
|
end
|
@@ -5,7 +5,7 @@ describe "Properties", :type => :feature do
|
|
5
5
|
|
6
6
|
before(:each) do
|
7
7
|
visit spree.admin_path
|
8
|
-
|
8
|
+
click_nav "Products"
|
9
9
|
end
|
10
10
|
|
11
11
|
context "Property index" do
|
@@ -82,7 +82,7 @@ describe "Properties", :type => :feature do
|
|
82
82
|
click_link "Product Properties"
|
83
83
|
end
|
84
84
|
|
85
|
-
# Regression test for
|
85
|
+
# Regression test for https://github.com/spree/spree/issues/2279
|
86
86
|
it "successfully create and then remove product property" do
|
87
87
|
fill_in_property
|
88
88
|
|
@@ -93,7 +93,7 @@ describe "Properties", :type => :feature do
|
|
93
93
|
check_property_row_count(1)
|
94
94
|
end
|
95
95
|
|
96
|
-
# Regression test for
|
96
|
+
# Regression test for https://github.com/spree/spree/issues/4466
|
97
97
|
it "successfully remove and create a product property at the same time" do
|
98
98
|
fill_in_property
|
99
99
|
|
@@ -32,7 +32,7 @@ describe "Prototypes", :type => :feature do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
visit spree.admin_path
|
35
|
-
|
35
|
+
click_nav "Products"
|
36
36
|
click_link "Prototypes"
|
37
37
|
|
38
38
|
within_row(1) { expect(column_text(1)).to eq "Shirt" }
|
@@ -44,7 +44,7 @@ describe "Prototypes", :type => :feature do
|
|
44
44
|
context "creating a prototype" do
|
45
45
|
it "should allow an admin to create a new product prototype", :js => true do
|
46
46
|
visit spree.admin_path
|
47
|
-
|
47
|
+
click_nav "Products"
|
48
48
|
click_link "Prototypes"
|
49
49
|
click_link "new_prototype_link"
|
50
50
|
within('#new_prototype') do
|
@@ -73,7 +73,7 @@ describe "Prototypes", :type => :feature do
|
|
73
73
|
end
|
74
74
|
|
75
75
|
visit spree.admin_path
|
76
|
-
|
76
|
+
click_nav "Products"
|
77
77
|
click_link "Prototypes"
|
78
78
|
|
79
79
|
click_on "Edit"
|
@@ -96,7 +96,7 @@ describe "Prototypes", :type => :feature do
|
|
96
96
|
shirt_prototype.taxons << create(:taxon)
|
97
97
|
|
98
98
|
visit spree.admin_path
|
99
|
-
|
99
|
+
click_nav "Products"
|
100
100
|
click_link "Prototypes"
|
101
101
|
|
102
102
|
within("#spree_prototype_#{shirt_prototype.id}") do
|
@@ -16,19 +16,19 @@ describe "Stock Management", :type => :feature do
|
|
16
16
|
before do
|
17
17
|
stock_location.stock_item(variant).update_column(:count_on_hand, 10)
|
18
18
|
|
19
|
-
|
19
|
+
click_nav "Products"
|
20
20
|
within_row(1) { click_icon :edit }
|
21
21
|
click_link "Stock Management"
|
22
22
|
end
|
23
23
|
|
24
|
-
# Regression test for
|
24
|
+
# Regression test for https://github.com/spree/spree/issues/3304
|
25
25
|
# It is OK to still render the stock page, ensure no errors in this case
|
26
26
|
context "with no stock location" do
|
27
27
|
before do
|
28
28
|
@product = create(:product, name: 'apache baseball cap', price: 10)
|
29
29
|
v = @product.variants.create!(sku: 'FOOBAR')
|
30
30
|
Spree::StockLocation.destroy_all
|
31
|
-
click_link "Products"
|
31
|
+
click_link "Back To Products List"
|
32
32
|
within_row(1) do
|
33
33
|
click_icon :edit
|
34
34
|
end
|
@@ -58,9 +58,9 @@ describe "Stock Management", :type => :feature do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def adjust_count_on_hand(count_on_hand)
|
61
|
-
find(:css, ".fa-edit[data-id='#{stock_item.id}']").click
|
61
|
+
find(:css, ".fa-edit[data-id='#{stock_item.id}']").trigger('click')
|
62
62
|
find(:css, "[data-variant-id='#{variant.id}'] input[type='number']").set(count_on_hand)
|
63
|
-
find(:css, ".fa-check[data-id='#{stock_item.id}']").click
|
63
|
+
find(:css, ".fa-check[data-id='#{stock_item.id}']").trigger('click')
|
64
64
|
expect(page).to have_content('Updated successfully')
|
65
65
|
end
|
66
66
|
|
@@ -13,16 +13,16 @@ describe "Variants", :type => :feature do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
visit spree.admin_path
|
16
|
-
|
16
|
+
click_nav "Products"
|
17
17
|
within_row(1) { click_icon :edit }
|
18
18
|
click_link "Variants"
|
19
19
|
click_on "New Variant"
|
20
|
-
expect(
|
21
|
-
expect(
|
22
|
-
expect(
|
23
|
-
expect(
|
24
|
-
expect(
|
25
|
-
expect(
|
20
|
+
expect(page).to have_field('variant_price', with: "1.99")
|
21
|
+
expect(page).to have_field('variant_cost_price', with: "1.00")
|
22
|
+
expect(page).to have_field('variant_weight', with: "2.50")
|
23
|
+
expect(page).to have_field('variant_height', with: "3.00")
|
24
|
+
expect(page).to have_field('variant_width', with: "1.00")
|
25
|
+
expect(page).to have_field('variant_depth', with: "1.50")
|
26
26
|
expect(page).to have_select('variant[tax_category_id]')
|
27
27
|
end
|
28
28
|
end
|
@@ -38,7 +38,7 @@ describe "Variants", :type => :feature do
|
|
38
38
|
create(:variant, :product => product, :price => 19.99)
|
39
39
|
end
|
40
40
|
|
41
|
-
# Regression test for
|
41
|
+
# Regression test for https://github.com/spree/spree/issues/2737
|
42
42
|
context "uses руб as the currency symbol" do
|
43
43
|
it "on the products listing page" do
|
44
44
|
visit spree.admin_product_variants_path(product)
|
@@ -136,7 +136,7 @@ describe "Promotion Adjustments", :type => :feature do
|
|
136
136
|
expect(first_action_calculator.preferred_percent).to eq(10)
|
137
137
|
end
|
138
138
|
|
139
|
-
|
139
|
+
it "should allow an admin to create an automatic promotion with free shipping (no code)" do
|
140
140
|
fill_in "Name", :with => "Promotion"
|
141
141
|
click_button "Create"
|
142
142
|
expect(page).to have_content("Editing Promotion")
|
@@ -146,21 +146,14 @@ describe "Promotion Adjustments", :type => :feature do
|
|
146
146
|
find('[id$=_preferred_amount]').set(30)
|
147
147
|
within('#rule_fields') { click_button "Update" }
|
148
148
|
|
149
|
-
select2 "
|
149
|
+
select2 "Free shipping", :from => "Add action of type"
|
150
150
|
within('#action_fields') { click_button "Add" }
|
151
|
-
|
152
|
-
within('#actions_container') { click_button "Update" }
|
151
|
+
expect(page).to have_content('MAKES ALL SHIPMENTS FOR THE ORDER FREE')
|
153
152
|
|
154
153
|
promotion = Spree::Promotion.find_by_name("Promotion")
|
155
|
-
expect(promotion.
|
156
|
-
|
157
|
-
|
158
|
-
expect(first_rule.class).to eq(Spree::Promotion::Rules::ItemTotal)
|
159
|
-
|
160
|
-
first_action = promotion.actions.first
|
161
|
-
expect(first_action.class).to eq(Spree::Promotion::Actions::CreateAdjustment)
|
162
|
-
first_action_calculator = first_action.calculator
|
163
|
-
expect(first_action_calculator.class).to eq(Spree::Calculator::FreeShipping)
|
154
|
+
expect(promotion.codes).to be_empty
|
155
|
+
expect(promotion.rules.first).to be_a(Spree::Promotion::Rules::ItemTotal)
|
156
|
+
expect(promotion.actions.first).to be_a(Spree::Promotion::Actions::FreeShipping)
|
164
157
|
end
|
165
158
|
|
166
159
|
it "should allow an admin to create an automatic promo requiring a landing page to be visited" do
|