solidus_backend 1.0.7 → 1.1.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/javascripts/spree/backend.js +3 -0
- data/app/assets/javascripts/spree/backend/admin.js.erb +17 -24
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +3 -5
- data/app/assets/javascripts/spree/backend/flash.coffee +17 -0
- data/app/assets/javascripts/spree/backend/handlebars_extensions.coffee +9 -0
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/option_value_picker.js +43 -0
- data/app/assets/javascripts/spree/backend/product_picker.js +10 -8
- data/app/assets/javascripts/spree/backend/promotions.js.coffee +101 -0
- data/app/assets/javascripts/spree/backend/routes.js +2 -1
- data/app/assets/javascripts/spree/backend/shipments.js.erb +1 -1
- data/app/assets/javascripts/spree/backend/stock_management/index_add_forms.coffee +1 -1
- data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +2 -2
- data/app/assets/javascripts/spree/backend/stock_transfers/variant_form.coffee +1 -1
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +6 -7
- data/app/assets/javascripts/spree/backend/templates/orders/customer_details/autocomplete.hbs +17 -0
- data/app/assets/javascripts/spree/backend/templates/products/sortable.hbs +5 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +17 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +17 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values.hbs +10 -0
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values_select.hbs +1 -0
- data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +19 -0
- data/app/assets/javascripts/spree/backend/templates/stock_transfers/transfer_item.hbs.erb +52 -0
- data/app/assets/javascripts/spree/backend/templates/variants/autocomplete.hbs.erb +23 -0
- data/app/assets/javascripts/spree/backend/templates/variants/autocomplete_stock.hbs +51 -0
- data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs +67 -0
- data/app/assets/javascripts/spree/backend/templates/variants/split.hbs +27 -0
- data/app/assets/javascripts/spree/backend/user_picker.js +8 -8
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee.erb +6 -8
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +6 -3
- data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +16 -0
- data/app/controllers/spree/admin/base_controller.rb +1 -1
- data/app/controllers/spree/admin/option_types_controller.rb +1 -3
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +6 -11
- data/app/controllers/spree/admin/product_properties_controller.rb +9 -0
- data/app/controllers/spree/admin/products_controller.rb +20 -5
- data/app/controllers/spree/admin/promotions_controller.rb +2 -1
- data/app/controllers/spree/admin/reimbursements_controller.rb +20 -0
- data/app/controllers/spree/admin/resource_controller.rb +1 -1
- data/app/controllers/spree/admin/return_authorizations_controller.rb +5 -0
- data/app/controllers/spree/admin/root_controller.rb +1 -1
- data/app/controllers/spree/admin/search_controller.rb +2 -4
- data/app/controllers/spree/admin/states_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_items_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_transfers_controller.rb +3 -14
- data/app/controllers/spree/admin/users_controller.rb +2 -3
- data/app/controllers/spree/admin/variant_property_rule_values_controller.rb +7 -0
- data/app/controllers/spree/admin/variants_controller.rb +1 -1
- data/app/controllers/spree/admin/zones_controller.rb +1 -1
- data/app/helpers/spree/admin/adjustments_helper.rb +4 -9
- data/app/helpers/spree/admin/base_helper.rb +7 -6
- data/app/helpers/spree/admin/navigation_helper.rb +8 -2
- 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/_adjustment.html.erb +1 -1
- data/app/views/spree/admin/orders/_add_line_item.html.erb +0 -5
- data/app/views/spree/admin/orders/_add_product.html.erb +0 -3
- data/app/views/spree/admin/orders/_carton.html.erb +0 -1
- data/app/views/spree/admin/orders/_shipment.html.erb +0 -1
- data/app/views/spree/admin/orders/confirm/_shipment.html.erb +0 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +0 -1
- data/app/views/spree/admin/orders/index.html.erb +1 -2
- data/app/views/spree/admin/payment_methods/_form.html.erb +0 -4
- data/app/views/spree/admin/payment_methods/index.html.erb +0 -2
- data/app/views/spree/admin/payments/source_views/_gateway.html.erb +3 -0
- data/app/views/spree/admin/product_properties/index.html.erb +52 -2
- data/app/views/spree/admin/promotions/_actions.html.erb +14 -10
- data/app/views/spree/admin/promotions/_promotion_action.html.erb +5 -3
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +5 -3
- data/app/views/spree/admin/promotions/_rules.html.erb +18 -14
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +5 -28
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +5 -27
- data/app/views/spree/admin/promotions/edit.html.erb +6 -4
- data/app/views/spree/admin/promotions/index.html.erb +1 -1
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +13 -0
- data/app/views/spree/admin/refund_reasons/index.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/_form.html.erb +2 -2
- data/app/views/spree/admin/search/users.rabl +1 -1
- data/app/views/spree/admin/shared/_order_summary.html.erb +6 -0
- data/app/views/spree/admin/shared/_tabs.html.erb +2 -2
- data/app/views/spree/admin/shared/_translations.html.erb +16 -46
- data/app/views/spree/admin/shared/named_types/_index.html.erb +2 -2
- data/app/views/spree/admin/stock_items/_stock_management.html.erb +0 -2
- data/app/views/spree/admin/stock_movements/_form.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/edit.html.erb +0 -3
- data/app/views/spree/admin/stock_transfers/receive.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/show.html.erb +1 -1
- data/app/views/spree/admin/taxons/index.html.erb +0 -1
- data/app/views/spree/admin/users/_addresses_form.html.erb +4 -4
- data/app/views/spree/layouts/admin.html.erb +11 -9
- data/config/routes.rb +5 -0
- data/lib/spree/backend.rb +1 -2
- metadata +41 -139
- data/CHANGELOG.md +0 -1
- data/Gemfile +0 -6
- data/Rakefile +0 -15
- data/app/assets/javascripts/spree/backend/handlebar_extensions.js +0 -9
- data/app/assets/javascripts/spree/backend/promotions.js +0 -73
- data/app/assets/javascripts/spree/backend/stock_transfer.js.coffee +0 -196
- data/app/views/spree/admin/products/_autocomplete.js.erb +0 -14
- data/app/views/spree/admin/products/_sortable.html +0 -7
- data/app/views/spree/admin/stock_items/_stock_location_stock_item_template.html.erb +0 -21
- data/app/views/spree/admin/stock_transfers/_transfer_item_template.html.erb +0 -54
- data/app/views/spree/admin/variants/_autocomplete.js.erb +0 -25
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +0 -69
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +0 -53
- data/app/views/spree/admin/variants/_split.js.erb +0 -29
- data/script/rails +0 -9
- data/solidus_backend.gemspec +0 -30
- data/spec/controllers/spree/admin/base_controller_spec.rb +0 -24
- data/spec/controllers/spree/admin/cancellations_controller_spec.rb +0 -77
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +0 -234
- data/spec/controllers/spree/admin/general_settings_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +0 -18
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +0 -80
- data/spec/controllers/spree/admin/orders_controller_spec.rb +0 -472
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +0 -49
- data/spec/controllers/spree/admin/payments_controller_spec.rb +0 -175
- data/spec/controllers/spree/admin/products_controller_spec.rb +0 -45
- data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +0 -21
- data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +0 -18
- data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +0 -21
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +0 -122
- data/spec/controllers/spree/admin/refunds_controller_spec.rb +0 -32
- data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +0 -75
- data/spec/controllers/spree/admin/reports_controller_spec.rb +0 -134
- data/spec/controllers/spree/admin/resource_controller_spec.rb +0 -166
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +0 -226
- data/spec/controllers/spree/admin/return_items_controller_spec.rb +0 -27
- data/spec/controllers/spree/admin/root_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/search_controller_spec.rb +0 -104
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +0 -14
- data/spec/controllers/spree/admin/stock_items_controller_spec.rb +0 -50
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +0 -331
- data/spec/controllers/spree/admin/store_credits_controller_spec.rb +0 -309
- data/spec/controllers/spree/admin/users_controller_spec.rb +0 -236
- data/spec/controllers/spree/admin/variants_controller_spec.rb +0 -32
- data/spec/features/admin/configuration/analytics_tracker_spec.rb +0 -54
- data/spec/features/admin/configuration/countries_spec.rb +0 -22
- data/spec/features/admin/configuration/general_settings_spec.rb +0 -45
- data/spec/features/admin/configuration/payment_methods_spec.rb +0 -125
- data/spec/features/admin/configuration/shipping_methods_spec.rb +0 -64
- data/spec/features/admin/configuration/states_spec.rb +0 -64
- data/spec/features/admin/configuration/stock_locations_spec.rb +0 -50
- data/spec/features/admin/configuration/tax_categories_spec.rb +0 -56
- data/spec/features/admin/configuration/tax_rates_spec.rb +0 -30
- data/spec/features/admin/configuration/taxonomies_spec.rb +0 -52
- data/spec/features/admin/configuration/zones_spec.rb +0 -39
- data/spec/features/admin/homepage_spec.rb +0 -78
- data/spec/features/admin/locale_spec.rb +0 -30
- data/spec/features/admin/orders/adjustments_promotions_spec.rb +0 -53
- data/spec/features/admin/orders/adjustments_spec.rb +0 -126
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +0 -48
- data/spec/features/admin/orders/cancelling_inventory_spec.rb +0 -48
- data/spec/features/admin/orders/customer_details_spec.rb +0 -163
- data/spec/features/admin/orders/line_items_spec.rb +0 -50
- data/spec/features/admin/orders/listing_spec.rb +0 -130
- data/spec/features/admin/orders/log_entries_spec.rb +0 -55
- data/spec/features/admin/orders/new_order_spec.rb +0 -197
- data/spec/features/admin/orders/order_details_spec.rb +0 -533
- data/spec/features/admin/orders/payments_spec.rb +0 -228
- data/spec/features/admin/orders/risk_analysis_spec.rb +0 -47
- data/spec/features/admin/orders/shipments_spec.rb +0 -65
- data/spec/features/admin/payments/store_credits_spec.rb +0 -21
- data/spec/features/admin/products/edit/images_spec.rb +0 -87
- data/spec/features/admin/products/edit/products_spec.rb +0 -66
- data/spec/features/admin/products/edit/taxons_spec.rb +0 -56
- data/spec/features/admin/products/edit/variants_spec.rb +0 -61
- data/spec/features/admin/products/option_types_spec.rb +0 -114
- data/spec/features/admin/products/products_spec.rb +0 -392
- data/spec/features/admin/products/properties_spec.rb +0 -139
- data/spec/features/admin/products/prototypes_spec.rb +0 -110
- data/spec/features/admin/products/stock_management_spec.rb +0 -82
- data/spec/features/admin/products/variant_spec.rb +0 -51
- data/spec/features/admin/promotion_adjustments_spec.rb +0 -220
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +0 -69
- data/spec/features/admin/promotions/user_rule_spec.rb +0 -25
- data/spec/features/admin/reports_spec.rb +0 -61
- data/spec/features/admin/stock_transfer_spec.rb +0 -86
- data/spec/features/admin/store_credits_spec.rb +0 -82
- data/spec/features/admin/taxons_spec.rb +0 -31
- data/spec/features/admin/users_spec.rb +0 -270
- data/spec/helpers/admin/base_helper_spec.rb +0 -24
- data/spec/helpers/admin/navigation_helper_spec.rb +0 -73
- data/spec/helpers/admin/reimbursements_helper_spec.rb +0 -34
- data/spec/helpers/admin/stock_movements_helper_spec.rb +0 -29
- data/spec/helpers/admin/store_credit_events_helper_spec.rb +0 -95
- data/spec/helpers/promotion_rules_helper_spec.rb +0 -12
- data/spec/spec_helper.rb +0 -108
- data/spec/support/appear_before_matcher.rb +0 -8
- data/spec/support/ror_ringer.jpeg +0 -0
- data/spec/test_views/spree/admin/widgets/edit.html.erb +0 -1
- data/spec/test_views/spree/admin/widgets/new.html.erb +0 -1
- data/vendor/assets/javascripts/handlebars.js +0 -2746
@@ -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,54 +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
|
-
2.times { create(:tracker, :environment => "test") }
|
9
|
-
visit spree.admin_path
|
10
|
-
click_link "Settings"
|
11
|
-
click_link "Analytics Tracker"
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should have the right content" do
|
15
|
-
expect(page).to have_content("Analytics Trackers")
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should have the right tabular values displayed" do
|
19
|
-
within_row(1) do
|
20
|
-
expect(column_text(1)).to eq("A100")
|
21
|
-
expect(column_text(2)).to eq("Test")
|
22
|
-
expect(column_text(3)).to eq("Yes")
|
23
|
-
end
|
24
|
-
|
25
|
-
within_row(2) do
|
26
|
-
expect(column_text(1)).to eq("A100")
|
27
|
-
expect(column_text(2)).to eq("Test")
|
28
|
-
expect(column_text(3)).to eq("Yes")
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
context "create" do
|
34
|
-
before(:each) do
|
35
|
-
visit spree.admin_path
|
36
|
-
click_link "Settings"
|
37
|
-
click_link "Analytics Tracker"
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should be able to create a new analytics tracker" do
|
41
|
-
click_link "admin_new_tracker_link"
|
42
|
-
fill_in "tracker_analytics_id", :with => "A100"
|
43
|
-
select "Test", :from => "tracker-env"
|
44
|
-
click_button "Create"
|
45
|
-
|
46
|
-
expect(page).to have_content("successfully created!")
|
47
|
-
within_row(1) do
|
48
|
-
expect(column_text(1)).to eq("A100")
|
49
|
-
expect(column_text(2)).to eq("Test")
|
50
|
-
expect(column_text(3)).to eq("Yes")
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
module Spree
|
4
|
-
describe "Countries", type: :feature do
|
5
|
-
stub_authorization!
|
6
|
-
|
7
|
-
it "deletes a country", 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 :trash
|
17
|
-
end
|
18
|
-
|
19
|
-
expect(page).to have_content 'Country "Brazil" has been successfully removed!'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "General Settings", type: :feature, js: true 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.admin_path
|
10
|
-
click_link "Settings"
|
11
|
-
click_link "General Settings"
|
12
|
-
end
|
13
|
-
|
14
|
-
context "visiting general settings (admin)" do
|
15
|
-
it "should have the right content" do
|
16
|
-
expect(page).to have_content("General Settings")
|
17
|
-
expect(find("#store_name").value).to eq("Test Store")
|
18
|
-
expect(find("#store_url").value).to eq("test.example.org")
|
19
|
-
expect(find("#store_mail_from_address").value).to eq("test@example.org")
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
context "editing general settings (admin)" do
|
24
|
-
it "should be able to update the site name" do
|
25
|
-
fill_in "store_name", with: "Spree Demo Site99"
|
26
|
-
fill_in "store_mail_from_address", with: "spree@example.org"
|
27
|
-
click_button "Update"
|
28
|
-
|
29
|
-
assert_successful_update_message(:general_settings)
|
30
|
-
expect(find("#store_name").value).to eq("Spree Demo Site99")
|
31
|
-
expect(find("#store_mail_from_address").value).to eq("spree@example.org")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context "clearing the cache" do
|
36
|
-
it "should clear the cache" do
|
37
|
-
expect(page).to_not have_content(Spree.t(:clear_cache_ok))
|
38
|
-
expect(page).to have_content(Spree.t(:clear_cache_warning))
|
39
|
-
|
40
|
-
click_button "Clear Cache"
|
41
|
-
|
42
|
-
expect(page).to have_content(Spree.t(:clear_cache_ok))
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -1,125 +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_path
|
8
|
-
click_link "Settings"
|
9
|
-
end
|
10
|
-
|
11
|
-
context "admin visiting payment methods listing page" do
|
12
|
-
it "should display existing payment methods" do
|
13
|
-
create(:check_payment_method)
|
14
|
-
click_link "Payment Methods"
|
15
|
-
|
16
|
-
within("table#listing_payment_methods") do
|
17
|
-
expect(all("th")[0].text).to eq("Name")
|
18
|
-
expect(all("th")[1].text).to eq("Provider")
|
19
|
-
expect(all("th")[2].text).to eq("Environment")
|
20
|
-
expect(all("th")[3].text).to eq("Display")
|
21
|
-
expect(all("th")[4].text).to eq("Active")
|
22
|
-
end
|
23
|
-
|
24
|
-
within('table#listing_payment_methods') do
|
25
|
-
expect(page).to have_content("Spree::PaymentMethod::Check")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context "admin creating a new payment method" do
|
31
|
-
it "should be able to create a new payment method" do
|
32
|
-
click_link "Payment Methods"
|
33
|
-
click_link "admin_new_payment_methods_link"
|
34
|
-
expect(page).to have_content("New Payment Method")
|
35
|
-
fill_in "payment_method_name", :with => "check90"
|
36
|
-
fill_in "payment_method_description", :with => "check90 desc"
|
37
|
-
select "PaymentMethod::Check", :from => "gtwy-type"
|
38
|
-
click_button "Create"
|
39
|
-
expect(page).to have_content("successfully created!")
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
context "admin editing a payment method" do
|
44
|
-
before(:each) do
|
45
|
-
create(:check_payment_method)
|
46
|
-
click_link "Payment Methods"
|
47
|
-
within("table#listing_payment_methods") do
|
48
|
-
click_icon(:edit)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should be able to edit an existing payment method" do
|
53
|
-
fill_in "payment_method_name", :with => "Payment 99"
|
54
|
-
click_button "Update"
|
55
|
-
expect(page).to have_content("successfully updated!")
|
56
|
-
expect(find_field("payment_method_name").value).to eq("Payment 99")
|
57
|
-
end
|
58
|
-
|
59
|
-
it "should display validation errors" do
|
60
|
-
fill_in "payment_method_name", :with => ""
|
61
|
-
click_button "Update"
|
62
|
-
expect(page).to have_content("Name can't be blank")
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
context "changing type and payment_source", js: true do
|
67
|
-
after do
|
68
|
-
# cleanup
|
69
|
-
Spree::Config.static_model_preferences.for_class(Spree::Gateway::Bogus).clear
|
70
|
-
end
|
71
|
-
|
72
|
-
it "displays message when changing type" do
|
73
|
-
create(:credit_card_payment_method)
|
74
|
-
click_link "Payment Methods"
|
75
|
-
click_icon :edit
|
76
|
-
expect(page).to have_content('TEST MODE')
|
77
|
-
|
78
|
-
select2_search 'Spree::PaymentMethod::Check', from: 'Provider'
|
79
|
-
expect(page).to have_content('you must save first')
|
80
|
-
expect(page).to have_no_content('TEST MODE')
|
81
|
-
|
82
|
-
# change back
|
83
|
-
select2_search 'Spree::Gateway::Bogus', from: 'Provider'
|
84
|
-
expect(page).to have_no_content('you must save first')
|
85
|
-
expect(page).to have_content('TEST MODE')
|
86
|
-
end
|
87
|
-
|
88
|
-
it "displays message when changing preference source" do
|
89
|
-
Spree::Config.static_model_preferences.add(Spree::Gateway::Bogus, 'my_prefs', {})
|
90
|
-
|
91
|
-
create(:credit_card_payment_method)
|
92
|
-
click_link "Payment Methods"
|
93
|
-
click_icon :edit
|
94
|
-
expect(page).to have_content('TEST MODE')
|
95
|
-
|
96
|
-
select2_search 'my_prefs', from: 'Preference Source'
|
97
|
-
expect(page).to have_content('you must save first')
|
98
|
-
expect(page).to have_no_content('TEST MODE')
|
99
|
-
|
100
|
-
# change back
|
101
|
-
select2_search 'Custom', from: 'Preference Source'
|
102
|
-
expect(page).to have_no_content('you must save first')
|
103
|
-
expect(page).to have_content('TEST MODE')
|
104
|
-
end
|
105
|
-
|
106
|
-
it "updates successfully and keeps secrets" do
|
107
|
-
Spree::Config.static_model_preferences.add(Spree::Gateway::Bogus, 'my_prefs', {server: 'secret'})
|
108
|
-
|
109
|
-
create(:credit_card_payment_method)
|
110
|
-
click_link "Payment Methods"
|
111
|
-
click_icon :edit
|
112
|
-
|
113
|
-
select2_search 'my_prefs', from: 'Preference Source'
|
114
|
-
click_on 'Update'
|
115
|
-
expect(page).to have_content('Using static preferences')
|
116
|
-
expect(page).to have_no_content('secret')
|
117
|
-
|
118
|
-
# change back
|
119
|
-
select2_search 'Custom', from: 'Preference Source'
|
120
|
-
click_on 'Update'
|
121
|
-
expect(page).to have_content('TEST MODE')
|
122
|
-
expect(page).to have_no_content('secret')
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
@@ -1,64 +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, :environment => 'test')
|
17
|
-
|
18
|
-
visit spree.admin_path
|
19
|
-
click_link "Settings"
|
20
|
-
click_link "Shipping Methods"
|
21
|
-
end
|
22
|
-
|
23
|
-
context "show" do
|
24
|
-
it "should display existing shipping methods" do
|
25
|
-
within_row(1) do
|
26
|
-
expect(column_text(1)).to eq(shipping_method.name)
|
27
|
-
expect(column_text(2)).to eq(zone.name)
|
28
|
-
expect(column_text(3)).to eq("Flat rate")
|
29
|
-
expect(column_text(4)).to eq("Both")
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context "create" do
|
35
|
-
it "should be able to create a new shipping method" do
|
36
|
-
click_link "New Shipping Method"
|
37
|
-
|
38
|
-
fill_in "shipping_method_name", :with => "bullock cart"
|
39
|
-
|
40
|
-
within("#shipping_method_categories_field") do
|
41
|
-
check first("input[type='checkbox']")["name"]
|
42
|
-
end
|
43
|
-
|
44
|
-
click_on "Create"
|
45
|
-
expect(current_path).to eql(spree.edit_admin_shipping_method_path(Spree::ShippingMethod.last))
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# Regression test for #1331
|
50
|
-
context "update" do
|
51
|
-
it "can change the calculator", :js => true do
|
52
|
-
within("#listing_shipping_methods") do
|
53
|
-
click_icon :edit
|
54
|
-
end
|
55
|
-
|
56
|
-
expect(find(:css, ".calculator-settings-warning")).not_to be_visible
|
57
|
-
select2_search('Flexible Rate', :from => 'Calculator')
|
58
|
-
expect(find(:css, ".calculator-settings-warning")).to be_visible
|
59
|
-
|
60
|
-
click_button "Update"
|
61
|
-
expect(page).not_to have_content("Shipping method is not found")
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "States", :type => :feature do
|
4
|
-
stub_authorization!
|
5
|
-
|
6
|
-
let!(:country) { create(:country) }
|
7
|
-
|
8
|
-
let!(:hungary) do
|
9
|
-
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_css("#new_state_link")
|
15
|
-
end
|
16
|
-
|
17
|
-
context "admin visiting states listing" do
|
18
|
-
let!(:state) { create(:state, :country => country) }
|
19
|
-
|
20
|
-
it "should correctly display the states" do
|
21
|
-
visit spree.admin_country_states_path(country)
|
22
|
-
expect(page).to have_content(state.name)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context "creating and editing states" do
|
27
|
-
it "should allow an admin to edit existing states", :js => true do
|
28
|
-
go_to_states_page
|
29
|
-
select2 country.name, from: 'Country'
|
30
|
-
|
31
|
-
click_link "new_state_link"
|
32
|
-
fill_in "state_name", :with => "Calgary"
|
33
|
-
fill_in "Abbreviation", :with => "CL"
|
34
|
-
click_button "Create"
|
35
|
-
expect(page).to have_content("successfully created!")
|
36
|
-
expect(page).to have_content("Calgary")
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should allow an admin to create states for non default countries", :js => true do
|
40
|
-
go_to_states_page
|
41
|
-
select2 hungary.name, from: 'Country'
|
42
|
-
|
43
|
-
click_link "new_state_link"
|
44
|
-
fill_in "state_name", :with => "Pest megye"
|
45
|
-
fill_in "Abbreviation", :with => "PE"
|
46
|
-
click_button "Create"
|
47
|
-
expect(page).to have_content("successfully created!")
|
48
|
-
expect(page).to have_content("Pest megye")
|
49
|
-
expect(find("#s2id_country span").text).to eq("Hungary")
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should show validation errors", :js => true do
|
53
|
-
go_to_states_page
|
54
|
-
select2 country.name, from: 'Country'
|
55
|
-
|
56
|
-
click_link "new_state_link"
|
57
|
-
|
58
|
-
fill_in "state_name", :with => ""
|
59
|
-
fill_in "Abbreviation", :with => ""
|
60
|
-
click_button "Create"
|
61
|
-
expect(page).to have_content("Name can't be blank")
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,50 +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_path
|
9
|
-
click_link "Settings"
|
10
|
-
click_link "Stock Locations"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "can create a new stock location" do
|
14
|
-
click_link "New Stock Location"
|
15
|
-
fill_in "Name", with: "London"
|
16
|
-
check "Active"
|
17
|
-
click_button "Create"
|
18
|
-
|
19
|
-
expect(page).to have_content("successfully created")
|
20
|
-
expect(page).to have_content("London")
|
21
|
-
end
|
22
|
-
|
23
|
-
it "can delete an existing stock location", js: true do
|
24
|
-
location = create(:stock_location)
|
25
|
-
visit current_path
|
26
|
-
|
27
|
-
expect(find('#listing_stock_locations')).to have_content("NY Warehouse")
|
28
|
-
accept_alert do
|
29
|
-
click_icon :trash
|
30
|
-
end
|
31
|
-
# Wait for API request to complete.
|
32
|
-
wait_for_ajax
|
33
|
-
visit current_path
|
34
|
-
expect(page).to have_content("NO STOCK LOCATIONS FOUND")
|
35
|
-
end
|
36
|
-
|
37
|
-
it "can update an existing stock location" do
|
38
|
-
create(:stock_location)
|
39
|
-
visit current_path
|
40
|
-
|
41
|
-
expect(page).to have_content("NY Warehouse")
|
42
|
-
|
43
|
-
click_icon :edit
|
44
|
-
fill_in "Name", with: "London"
|
45
|
-
click_button "Update"
|
46
|
-
|
47
|
-
expect(page).to have_content("successfully updated")
|
48
|
-
expect(page).to have_content("London")
|
49
|
-
end
|
50
|
-
end
|