spree_backend 3.1.5 → 3.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/admin/orders_controller.rb +1 -3
  3. data/app/controllers/spree/admin/products_controller.rb +1 -1
  4. data/app/views/spree/admin/products/_form.html.erb +8 -8
  5. data/app/views/spree/admin/products/index.html.erb +1 -1
  6. data/app/views/spree/admin/shared/_product_tabs.html.erb +4 -4
  7. data/app/views/spree/admin/taxons/edit.html.erb +1 -1
  8. data/spree_backend.gemspec +1 -1
  9. metadata +7 -98
  10. data/spec/controllers/spree/admin/base_controller_spec.rb +0 -46
  11. data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +0 -185
  12. data/spec/controllers/spree/admin/general_settings_controller_spec.rb +0 -41
  13. data/spec/controllers/spree/admin/missing_products_controller_spec.rb +0 -18
  14. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +0 -197
  15. data/spec/controllers/spree/admin/orders_controller_spec.rb +0 -254
  16. data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +0 -49
  17. data/spec/controllers/spree/admin/payments_controller_spec.rb +0 -97
  18. data/spec/controllers/spree/admin/products_controller_spec.rb +0 -99
  19. data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +0 -21
  20. data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +0 -21
  21. data/spec/controllers/spree/admin/promotions_controller_spec.rb +0 -44
  22. data/spec/controllers/spree/admin/refunds_controller_spec.rb +0 -32
  23. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +0 -74
  24. data/spec/controllers/spree/admin/reports_controller_spec.rb +0 -42
  25. data/spec/controllers/spree/admin/resource_controller_spec.rb +0 -252
  26. data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +0 -225
  27. data/spec/controllers/spree/admin/return_index_controller_spec.rb +0 -37
  28. data/spec/controllers/spree/admin/return_items_controller_spec.rb +0 -27
  29. data/spec/controllers/spree/admin/root_controller_spec.rb +0 -35
  30. data/spec/controllers/spree/admin/search_controller_spec.rb +0 -56
  31. data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +0 -14
  32. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +0 -19
  33. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +0 -41
  34. data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +0 -41
  35. data/spec/controllers/spree/admin/tax_categories_controller_spec.rb +0 -34
  36. data/spec/controllers/spree/admin/users_controller_spec.rb +0 -161
  37. data/spec/controllers/spree/admin/variants_controller_spec.rb +0 -32
  38. data/spec/features/admin/configuration/analytics_tracker_spec.rb +0 -47
  39. data/spec/features/admin/configuration/countries_spec.rb +0 -24
  40. data/spec/features/admin/configuration/general_settings_spec.rb +0 -44
  41. data/spec/features/admin/configuration/payment_methods_spec.rb +0 -63
  42. data/spec/features/admin/configuration/roles_spec.rb +0 -47
  43. data/spec/features/admin/configuration/shipping_methods_spec.rb +0 -62
  44. data/spec/features/admin/configuration/states_spec.rb +0 -68
  45. data/spec/features/admin/configuration/stock_locations_spec.rb +0 -48
  46. data/spec/features/admin/configuration/store_credit_categories_spec.rb +0 -50
  47. data/spec/features/admin/configuration/tax_categories_spec.rb +0 -56
  48. data/spec/features/admin/configuration/tax_rates_spec.rb +0 -18
  49. data/spec/features/admin/configuration/zones_spec.rb +0 -39
  50. data/spec/features/admin/homepage_spec.rb +0 -89
  51. data/spec/features/admin/locale_spec.rb +0 -31
  52. data/spec/features/admin/orders/adjustments_promotions_spec.rb +0 -53
  53. data/spec/features/admin/orders/adjustments_spec.rb +0 -129
  54. data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +0 -47
  55. data/spec/features/admin/orders/customer_details_spec.rb +0 -154
  56. data/spec/features/admin/orders/line_items_spec.rb +0 -51
  57. data/spec/features/admin/orders/listing_spec.rb +0 -222
  58. data/spec/features/admin/orders/log_entries_spec.rb +0 -55
  59. data/spec/features/admin/orders/new_order_spec.rb +0 -160
  60. data/spec/features/admin/orders/order_details_spec.rb +0 -662
  61. data/spec/features/admin/orders/payments_spec.rb +0 -230
  62. data/spec/features/admin/orders/risk_analysis_spec.rb +0 -48
  63. data/spec/features/admin/orders/shipments_spec.rb +0 -64
  64. data/spec/features/admin/orders/state_changes_spec.rb +0 -21
  65. data/spec/features/admin/products/edit/images_spec.rb +0 -86
  66. data/spec/features/admin/products/edit/products_spec.rb +0 -64
  67. data/spec/features/admin/products/edit/taxons_spec.rb +0 -41
  68. data/spec/features/admin/products/edit/variants_spec.rb +0 -56
  69. data/spec/features/admin/products/option_types_spec.rb +0 -114
  70. data/spec/features/admin/products/products_spec.rb +0 -445
  71. data/spec/features/admin/products/properties_spec.rb +0 -147
  72. data/spec/features/admin/products/prototypes_spec.rb +0 -112
  73. data/spec/features/admin/products/stock_management_spec.rb +0 -124
  74. data/spec/features/admin/products/taxonomies_spec.rb +0 -52
  75. data/spec/features/admin/products/variant_spec.rb +0 -50
  76. data/spec/features/admin/promotions/adjustments_spec.rb +0 -259
  77. data/spec/features/admin/promotions/option_value_rule_spec.rb +0 -70
  78. data/spec/features/admin/promotions/tiered_calculator_spec.rb +0 -70
  79. data/spec/features/admin/refund_reasons/refund_reasons_spec.rb +0 -57
  80. data/spec/features/admin/reports_spec.rb +0 -61
  81. data/spec/features/admin/return_authorization_reasons/return_authorization_reasons_spec.rb +0 -63
  82. data/spec/features/admin/returns/customer_returns_spec.rb +0 -80
  83. data/spec/features/admin/returns/return_authorizations_spec.rb +0 -152
  84. data/spec/features/admin/stock_transfer_spec.rb +0 -75
  85. data/spec/features/admin/store_credits_spec.rb +0 -93
  86. data/spec/features/admin/taxons_spec.rb +0 -47
  87. data/spec/features/admin/users_spec.rb +0 -286
  88. data/spec/helpers/admin/base_helper_spec.rb +0 -30
  89. data/spec/helpers/admin/navigation_helper_spec.rb +0 -106
  90. data/spec/helpers/admin/stock_movements_helper_spec.rb +0 -30
  91. data/spec/helpers/promotion_rules_helper_spec.rb +0 -12
  92. data/spec/models/spree/resource_spec.rb +0 -48
  93. data/spec/routing/admin_path_spec.rb +0 -22
  94. data/spec/spec_helper.rb +0 -134
  95. data/spec/support/appear_before_matcher.rb +0 -8
  96. data/spec/support/ror_ringer.jpeg +0 -0
  97. data/spec/test_views/spree/admin/submodule/posts/edit.html.erb +0 -1
  98. data/spec/test_views/spree/admin/submodule/posts/new.html.erb +0 -1
  99. data/spec/test_views/spree/admin/widgets/edit.html.erb +0 -1
  100. data/spec/test_views/spree/admin/widgets/new.html.erb +0 -1
@@ -1,32 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Spree
4
- module Admin
5
- describe VariantsController, :type => :controller do
6
- stub_authorization!
7
-
8
- describe "#index" do
9
- let(:product) { create(:product) }
10
- let!(:variant_1) { create(:variant, product: product) }
11
- let!(:variant_2) { create(:variant, product: product) }
12
-
13
- context "deleted is not requested" do
14
- it "assigns the variants for a requested product" do
15
- spree_get :index, product_id: product.slug
16
- expect(assigns(:collection)).to include variant_1
17
- expect(assigns(:collection)).to include variant_2
18
- end
19
- end
20
-
21
- context "deleted is requested" do
22
- before { variant_2.destroy }
23
- it "assigns only deleted variants for a requested product" do
24
- spree_get :index, product_id: product.slug, deleted: "on"
25
- expect(assigns(:collection)).not_to include variant_1
26
- expect(assigns(:collection)).to include variant_2
27
- end
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,47 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Analytics Tracker", type: :feature do
4
- stub_authorization!
5
-
6
- context "index" do
7
- before(:each) do
8
- create(:tracker)
9
- create(:tracker, analytics_id: 'A200')
10
- visit spree.admin_trackers_path
11
- end
12
-
13
- it "should have the right content" do
14
- expect(page).to have_content("Analytics Trackers")
15
- end
16
-
17
- it "should have the right tabular values displayed" do
18
- within_row(1) do
19
- expect(column_text(1)).to eq("A100")
20
- expect(column_text(2)).to eq("Yes")
21
- end
22
-
23
- within_row(2) do
24
- expect(column_text(1)).to eq("A200")
25
- expect(column_text(2)).to eq("Yes")
26
- end
27
- end
28
- end
29
-
30
- context "create" do
31
- before(:each) do
32
- visit spree.admin_trackers_path
33
- end
34
-
35
- it "should be able to create a new analytics tracker" do
36
- click_link "admin_new_tracker_link"
37
- fill_in "tracker_analytics_id", with: "A100"
38
- click_button "Create"
39
-
40
- expect(page).to have_content("successfully created!")
41
- within_row(1) do
42
- expect(column_text(1)).to eq("A100")
43
- expect(column_text(2)).to eq("Yes")
44
- end
45
- end
46
- end
47
- end
@@ -1,24 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Spree
4
- describe "Countries", type: :feature do
5
- stub_authorization!
6
-
7
- it "deletes a state", js: true do
8
- visit spree.admin_countries_path
9
- click_link "New Country"
10
-
11
- fill_in "Name", with: "Brazil"
12
- fill_in "Iso Name", with: "BRL"
13
- click_button "Create"
14
-
15
- accept_alert do
16
- click_icon :delete
17
- end
18
-
19
- wait_for_ajax
20
-
21
- expect { Country.find(country.id) }.to raise_error(StandardError)
22
- end
23
- end
24
- end
@@ -1,44 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "General Settings", type: :feature do
4
- stub_authorization!
5
-
6
- before(:each) do
7
- store = create(:store, name: 'Test Store', url: 'test.example.org',
8
- mail_from_address: 'test@example.org')
9
- visit spree.edit_admin_general_settings_path
10
- end
11
-
12
- context "visiting general settings (admin)" do
13
- it "should have the right content" do
14
- expect(page).to have_content("General Settings")
15
- expect(find("#store_name").value).to eq("Test Store")
16
- expect(find("#store_url").value).to eq("test.example.org")
17
- expect(find("#store_mail_from_address").value).to eq("test@example.org")
18
- expect(page).to_not have_content(Spree.t(:security_settings))
19
- end
20
- end
21
-
22
- context "editing general settings (admin)" do
23
- it "should be able to update the site name" do
24
- fill_in "store_name", with: "Spree Demo Site99"
25
- fill_in "store_mail_from_address", with: "spree@example.org"
26
- click_button "Update"
27
-
28
- assert_successful_update_message(:general_settings)
29
- expect(find("#store_name").value).to eq("Spree Demo Site99")
30
- expect(find("#store_mail_from_address").value).to eq("spree@example.org")
31
- end
32
- end
33
-
34
- context "clearing the cache", js: true do
35
- it "should clear the cache" do
36
- expect(page).to_not have_content(Spree.t(:clear_cache_ok))
37
- expect(page).to have_content(Spree.t(:clear_cache_warning))
38
-
39
- click_button "Clear Cache"
40
-
41
- expect(page).to have_content(Spree.t(:clear_cache_ok))
42
- end
43
- end
44
- end
@@ -1,63 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Payment Methods", type: :feature do
4
- stub_authorization!
5
-
6
- before(:each) do
7
- visit spree.admin_payment_methods_path
8
- end
9
-
10
- context "admin visiting payment methods listing page" do
11
- it "should display existing payment methods" do
12
- create(:check_payment_method)
13
- visit current_path
14
-
15
- within("table#listing_payment_methods") do
16
- expect(all("th")[1].text).to eq("Name")
17
- expect(all("th")[2].text).to eq("Provider")
18
- expect(all("th")[3].text).to eq("Display")
19
- expect(all("th")[4].text).to eq("Active")
20
- end
21
-
22
- within('table#listing_payment_methods') do
23
- expect(page).to have_content("Spree::PaymentMethod::Check")
24
- end
25
- end
26
- end
27
-
28
- context "admin creating a new payment method" do
29
- it "should be able to create a new payment method" do
30
- click_link "admin_new_payment_methods_link"
31
- expect(page).to have_content("New Payment Method")
32
- fill_in "payment_method_name", with: "check90"
33
- fill_in "payment_method_description", with: "check90 desc"
34
- select "PaymentMethod::Check", from: "gtwy-type"
35
- click_button "Create"
36
- expect(page).to have_content("successfully created!")
37
- end
38
- end
39
-
40
- context "admin editing a payment method", js: true do
41
- before(:each) do
42
- create(:check_payment_method)
43
- visit current_path
44
-
45
- within("table#listing_payment_methods") do
46
- click_icon(:edit)
47
- end
48
- end
49
-
50
- it "should be able to edit an existing payment method" do
51
- fill_in "payment_method_name", with: "Payment 99"
52
- click_button "Update"
53
- expect(page).to have_content("successfully updated!")
54
- expect(find_field("payment_method_name").value).to eq("Payment 99")
55
- end
56
-
57
- it "should display validation errors" do
58
- fill_in "payment_method_name", with: ""
59
- click_button "Update"
60
- expect(page).to have_content("Name can't be blank")
61
- end
62
- end
63
- end
@@ -1,47 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Roles", type: :feature do
4
- stub_authorization!
5
-
6
- before(:each) do
7
- create(:role, name: "admin")
8
- create(:role, name: "user")
9
- visit spree.admin_path
10
- click_link "Configuration"
11
- # Crap workaround for animation to finish expanding so click doesn't hit ReimbursementTypes.
12
- sleep 1
13
- click_link "Roles"
14
- end
15
-
16
- context "show" do
17
- it "should display existing roles" do
18
- within_row(1) { expect(page).to have_content("admin") }
19
- within_row(2) { expect(page).to have_content("user") }
20
- end
21
- end
22
-
23
- context "create" do
24
- it "should be able to create a new role" do
25
- click_link "admin_new_role_link"
26
- expect(page).to have_content("New Role")
27
- fill_in "role_name", with: "blogger"
28
- click_button "Create"
29
- expect(page).to have_content("successfully created!")
30
- end
31
- end
32
-
33
- context "edit" do
34
- it "should not be able to edit the admin role" do
35
- within_row(1) do
36
- expect(find("td:nth-child(2)")).not_to have_selector(:css, "span.icon-edit")
37
- expect(find("td:nth-child(2)")).not_to have_selector(:css, "span.icon-delete")
38
- end
39
- end
40
- it "should be able to edit the user role" do
41
- within_row(2) do
42
- expect(find("td:nth-child(2)")).to have_selector(:css, "span.icon-edit")
43
- expect(find("td:nth-child(2)")).to have_selector(:css, "span.icon-delete")
44
- end
45
- end
46
- end
47
- end
@@ -1,62 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Shipping Methods", type: :feature do
4
- stub_authorization!
5
- let!(:zone) { create(:global_zone) }
6
- let!(:shipping_method) { create(:shipping_method, zones: [zone]) }
7
-
8
- after do
9
- Capybara.ignore_hidden_elements = true
10
- end
11
-
12
- before do
13
- Capybara.ignore_hidden_elements = false
14
- # HACK: To work around no email prompting on check out
15
- allow_any_instance_of(Spree::Order).to receive_messages(require_email: false)
16
- create(:check_payment_method)
17
-
18
- visit spree.admin_shipping_methods_path
19
- end
20
-
21
- context "show" do
22
- it "should display existing shipping methods" do
23
- within_row(1) do
24
- expect(column_text(1)).to eq(shipping_method.name)
25
- expect(column_text(2)).to eq(zone.name)
26
- expect(column_text(3)).to eq("Flat rate")
27
- expect(column_text(4)).to eq("Both")
28
- end
29
- end
30
- end
31
-
32
- context "create" do
33
- it "should be able to create a new shipping method" do
34
- click_link "New Shipping Method"
35
-
36
- fill_in "shipping_method_name", with: "bullock cart"
37
-
38
- within("#shipping_method_categories_field") do
39
- check first("input[type='checkbox']")["name"]
40
- end
41
-
42
- click_on "Create"
43
- expect(current_path).to eql(spree.edit_admin_shipping_method_path(Spree::ShippingMethod.last))
44
- end
45
- end
46
-
47
- # Regression test for #1331
48
- context "update" do
49
- it "can change the calculator", js: true do
50
- within("#listing_shipping_methods") do
51
- click_icon :edit
52
- end
53
-
54
- expect(find(:css, ".calculator-settings-warning")).not_to be_visible
55
- select2_search('Flexible Rate', from: 'Calculator')
56
- expect(find(:css, ".calculator-settings-warning")).to be_visible
57
-
58
- click_button "Update"
59
- expect(page).not_to have_content("Shipping method is not found")
60
- end
61
- end
62
- end
@@ -1,68 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "States", type: :feature do
4
- stub_authorization!
5
-
6
- let!(:country) { create(:country) }
7
-
8
- before(:each) do
9
- @hungary = Spree::Country.create!(:name => "Hungary", :iso_name => "Hungary")
10
- end
11
-
12
- def go_to_states_page
13
- visit spree.admin_country_states_path(country)
14
- expect(page).to have_selector('#new_state_link')
15
- page.execute_script('$.fx.off = true')
16
- end
17
-
18
- context "admin visiting states listing" do
19
- let!(:state) { create(:state, :country => country) }
20
-
21
- it "should correctly display the states" do
22
- visit spree.admin_country_states_path(country)
23
- expect(page).to have_content(state.name)
24
- end
25
- end
26
-
27
- context "creating and editing states" do
28
- it "should allow an admin to edit existing states", js: true do
29
- go_to_states_page
30
- set_select2_field("country", country.id)
31
-
32
- click_link "new_state_link"
33
- fill_in "state_name", with: "Calgary"
34
- fill_in "Abbreviation", with: "CL"
35
- click_button "Create"
36
- expect(page).to have_content("successfully created!")
37
- expect(page).to have_content("Calgary")
38
- end
39
-
40
- it "should allow an admin to create states for non default countries", js: true do
41
- go_to_states_page
42
- set_select2_field "#country", @hungary.id
43
- # Just so the change event actually gets triggered in this spec
44
- # It is definitely triggered in the "real world"
45
- page.execute_script("$('#country').change();")
46
-
47
- click_link "new_state_link"
48
- fill_in "state_name", with: "Pest megye"
49
- fill_in "Abbreviation", with: "PE"
50
- click_button "Create"
51
- expect(page).to have_content("successfully created!")
52
- expect(page).to have_content("Pest megye")
53
- expect(find("#s2id_country span").text).to eq("Hungary")
54
- end
55
-
56
- it "should show validation errors", js: true do
57
- go_to_states_page
58
- set_select2_field("country", country.id)
59
-
60
- click_link "new_state_link"
61
-
62
- fill_in "state_name", with: ""
63
- fill_in "Abbreviation", with: ""
64
- click_button "Create"
65
- expect(page).to have_content("Name can't be blank")
66
- end
67
- end
68
- end
@@ -1,48 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Stock Locations", type: :feature do
4
- stub_authorization!
5
-
6
- before(:each) do
7
- country = create(:country)
8
- visit spree.admin_stock_locations_path
9
- end
10
-
11
- it "can create a new stock location" do
12
- click_link "New Stock Location"
13
- fill_in "Name", with: "London"
14
- check "Active"
15
- click_button "Create"
16
-
17
- expect(page).to have_content("successfully created")
18
- expect(page).to have_content("London")
19
- end
20
-
21
- it "can delete an existing stock location", js: true do
22
- location = create(:stock_location)
23
- visit current_path
24
-
25
- expect(find('#listing_stock_locations')).to have_content("NY Warehouse")
26
- accept_alert do
27
- click_icon :delete
28
- end
29
- # Wait for API request to complete.
30
- wait_for_ajax
31
- visit current_path
32
- expect(page).to have_content("No Stock Locations found")
33
- end
34
-
35
- it "can update an existing stock location", js: true do
36
- create(:stock_location)
37
- visit current_path
38
-
39
- expect(page).to have_content("NY Warehouse")
40
-
41
- click_icon :edit
42
- fill_in "Name", with: "London"
43
- click_button "Update"
44
-
45
- expect(page).to have_content("successfully updated")
46
- expect(page).to have_content("London")
47
- end
48
- end
@@ -1,50 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Store Credit Categories", type: :feature, js: true do
4
- stub_authorization!
5
-
6
- before(:each) do
7
- visit spree.admin_path
8
- click_link "Configuration"
9
- end
10
-
11
- context "admin visiting store credit categories list" do
12
- it "should display existing store credit categories" do
13
- create(:store_credit_category)
14
- click_link "Store Credit Categories"
15
-
16
- within_row(1) { expect(page).to have_content("Exchange") }
17
- end
18
- end
19
-
20
- context "admin creating a new store credit category" do
21
- before(:each) do
22
- click_link "Store Credit Categories"
23
- click_link "admin_new_store_credit_category_link"
24
- end
25
-
26
- it "should be able to create a new store credit category" do
27
- expect(page).to have_content("New Store Credit Category")
28
- fill_in "store_credit_category_name", with: "Return"
29
- click_button "Create"
30
- expect(page).to have_content("successfully created!")
31
- end
32
-
33
- it "should show validation errors if there are any" do
34
- click_button "Create"
35
- expect(page).to have_content("Name can't be blank")
36
- end
37
- end
38
-
39
- context "admin editing a store credit category" do
40
- it "should be able to update an existing store credit category" do
41
- create(:store_credit_category)
42
- click_link "Store Credit Categories"
43
- within_row(1) { click_icon :edit }
44
- fill_in "store_credit_category_name", with: "Return"
45
- click_button "Update"
46
- expect(page).to have_content("successfully updated!")
47
- expect(page).to have_content("Return")
48
- end
49
- end
50
- end