spree_backend 3.3.0.rc1 → 3.3.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/general_settings.js.coffee +12 -10
- data/app/controllers/spree/admin/orders_controller.rb +3 -4
- data/app/controllers/spree/admin/payments_controller.rb +2 -2
- data/app/controllers/spree/admin/products_controller.rb +3 -3
- data/app/controllers/spree/admin/return_authorizations_controller.rb +1 -1
- data/app/helpers/spree/admin/base_helper.rb +4 -1
- data/app/helpers/spree/admin/navigation_helper.rb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +8 -8
- data/app/views/spree/admin/promotions/actions/_create_line_items.html.erb +4 -2
- data/app/views/spree/admin/shared/_translations.html.erb +1 -0
- data/spree_backend.gemspec +1 -1
- metadata +7 -98
- data/spec/controllers/spree/admin/base_controller_spec.rb +0 -46
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +0 -185
- 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 -199
- data/spec/controllers/spree/admin/orders_controller_spec.rb +0 -296
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +0 -64
- data/spec/controllers/spree/admin/payments_controller_spec.rb +0 -97
- data/spec/controllers/spree/admin/products_controller_spec.rb +0 -137
- data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +0 -21
- data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +0 -21
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +0 -44
- data/spec/controllers/spree/admin/refunds_controller_spec.rb +0 -32
- data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +0 -74
- data/spec/controllers/spree/admin/reports_controller_spec.rb +0 -42
- data/spec/controllers/spree/admin/resource_controller_spec.rb +0 -252
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +0 -225
- data/spec/controllers/spree/admin/return_index_controller_spec.rb +0 -37
- data/spec/controllers/spree/admin/return_items_controller_spec.rb +0 -27
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +0 -14
- data/spec/controllers/spree/admin/stock_items_controller_spec.rb +0 -19
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +0 -41
- data/spec/controllers/spree/admin/tax_categories_controller_spec.rb +0 -34
- data/spec/controllers/spree/admin/users_controller_spec.rb +0 -161
- data/spec/controllers/spree/admin/variants_controller_spec.rb +0 -32
- data/spec/features/admin/configuration/analytics_tracker_spec.rb +0 -47
- data/spec/features/admin/configuration/countries_spec.rb +0 -24
- data/spec/features/admin/configuration/general_settings_spec.rb +0 -44
- data/spec/features/admin/configuration/payment_methods_spec.rb +0 -63
- data/spec/features/admin/configuration/roles_spec.rb +0 -47
- data/spec/features/admin/configuration/shipping_methods_spec.rb +0 -62
- data/spec/features/admin/configuration/states_spec.rb +0 -68
- data/spec/features/admin/configuration/stock_locations_spec.rb +0 -48
- data/spec/features/admin/configuration/store_credit_categories_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 -18
- data/spec/features/admin/configuration/zones_spec.rb +0 -39
- data/spec/features/admin/homepage_spec.rb +0 -89
- data/spec/features/admin/locale_spec.rb +0 -31
- data/spec/features/admin/orders/adjustments_promotions_spec.rb +0 -53
- data/spec/features/admin/orders/adjustments_spec.rb +0 -124
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +0 -47
- data/spec/features/admin/orders/customer_details_spec.rb +0 -154
- data/spec/features/admin/orders/line_items_spec.rb +0 -51
- data/spec/features/admin/orders/listing_spec.rb +0 -224
- data/spec/features/admin/orders/log_entries_spec.rb +0 -55
- data/spec/features/admin/orders/new_order_spec.rb +0 -186
- data/spec/features/admin/orders/order_details_spec.rb +0 -660
- data/spec/features/admin/orders/payments_spec.rb +0 -244
- data/spec/features/admin/orders/risk_analysis_spec.rb +0 -48
- data/spec/features/admin/orders/shipments_spec.rb +0 -64
- data/spec/features/admin/orders/state_changes_spec.rb +0 -21
- data/spec/features/admin/products/edit/images_spec.rb +0 -86
- data/spec/features/admin/products/edit/products_spec.rb +0 -56
- data/spec/features/admin/products/edit/taxons_spec.rb +0 -41
- data/spec/features/admin/products/edit/variants_spec.rb +0 -56
- data/spec/features/admin/products/option_types_spec.rb +0 -114
- data/spec/features/admin/products/products_spec.rb +0 -445
- data/spec/features/admin/products/properties_spec.rb +0 -147
- data/spec/features/admin/products/prototypes_spec.rb +0 -112
- data/spec/features/admin/products/stock_management_spec.rb +0 -124
- data/spec/features/admin/products/taxonomies_spec.rb +0 -52
- data/spec/features/admin/products/variant_spec.rb +0 -50
- data/spec/features/admin/promotions/adjustments_spec.rb +0 -258
- data/spec/features/admin/promotions/option_value_rule_spec.rb +0 -70
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +0 -70
- data/spec/features/admin/refund_reasons/refund_reasons_spec.rb +0 -57
- data/spec/features/admin/reimbursement_type/edit_reimbursement_type_spec.rb +0 -36
- data/spec/features/admin/reimbursement_type/new_reimbursement_type_spec.rb +0 -62
- data/spec/features/admin/reports_spec.rb +0 -61
- data/spec/features/admin/return_authorization_reasons/return_authorization_reasons_spec.rb +0 -63
- data/spec/features/admin/returns/customer_returns_spec.rb +0 -80
- data/spec/features/admin/returns/return_authorizations_spec.rb +0 -152
- data/spec/features/admin/stock_transfer_spec.rb +0 -91
- data/spec/features/admin/store_credits_spec.rb +0 -93
- data/spec/features/admin/taxons_spec.rb +0 -53
- data/spec/features/admin/users_spec.rb +0 -286
- data/spec/helpers/admin/base_helper_spec.rb +0 -30
- data/spec/helpers/admin/navigation_helper_spec.rb +0 -111
- data/spec/helpers/admin/promotion_rules_helper_spec.rb +0 -12
- data/spec/helpers/admin/stock_movements_helper_spec.rb +0 -30
- data/spec/models/spree/resource_spec.rb +0 -48
- data/spec/routing/admin_path_spec.rb +0 -22
- data/spec/spec_helper.rb +0 -144
- data/spec/support/appear_before_matcher.rb +0 -8
- data/spec/support/ror_ringer.jpeg +0 -0
- data/spec/test_views/spree/admin/submodule/posts/edit.html.erb +0 -1
- data/spec/test_views/spree/admin/submodule/posts/new.html.erb +0 -1
- data/spec/test_views/spree/admin/widgets/edit.html.erb +0 -1
- data/spec/test_views/spree/admin/widgets/new.html.erb +0 -1
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "Log entries", type: :feature do
|
4
|
-
stub_authorization!
|
5
|
-
|
6
|
-
let!(:payment) { create(:payment) }
|
7
|
-
|
8
|
-
context "with a successful log entry" do
|
9
|
-
before do
|
10
|
-
response = ActiveMerchant::Billing::Response.new(
|
11
|
-
true,
|
12
|
-
"Transaction successful",
|
13
|
-
transid: "ABCD1234"
|
14
|
-
)
|
15
|
-
|
16
|
-
payment.log_entries.create(
|
17
|
-
source: payment.source,
|
18
|
-
details: response.to_yaml
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
it "shows a successful attempt" do
|
23
|
-
visit spree.admin_order_payments_path(payment.order)
|
24
|
-
find("#payment_#{payment.id} a").click
|
25
|
-
click_link "Logs"
|
26
|
-
within("#listing_log_entries") do
|
27
|
-
expect(page).to have_content("Transaction successful")
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
context "with a failed log entry" do
|
33
|
-
before do
|
34
|
-
response = ActiveMerchant::Billing::Response.new(
|
35
|
-
false,
|
36
|
-
"Transaction failed",
|
37
|
-
transid: "ABCD1234"
|
38
|
-
)
|
39
|
-
|
40
|
-
payment.log_entries.create(
|
41
|
-
source: payment.source,
|
42
|
-
details: response.to_yaml
|
43
|
-
)
|
44
|
-
end
|
45
|
-
|
46
|
-
it "shows a failed attempt" do
|
47
|
-
visit spree.admin_order_payments_path(payment.order)
|
48
|
-
find("#payment_#{payment.id} a").click
|
49
|
-
click_link "Logs"
|
50
|
-
within("#listing_log_entries") do
|
51
|
-
expect(page).to have_content("Transaction failed")
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
@@ -1,186 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "New Order", type: :feature do
|
4
|
-
let!(:product) { create(:product_in_stock) }
|
5
|
-
let!(:state) { create(:state) }
|
6
|
-
let!(:user) { create(:user, ship_address: create(:address), bill_address: create(:address)) }
|
7
|
-
let!(:payment_method) { create(:check_payment_method) }
|
8
|
-
let!(:shipping_method) { create(:shipping_method) }
|
9
|
-
|
10
|
-
stub_authorization!
|
11
|
-
|
12
|
-
before do
|
13
|
-
# create default store
|
14
|
-
allow(Spree.user_class).to receive(:find_by).and_return(user)
|
15
|
-
create(:store)
|
16
|
-
visit spree.new_admin_order_path
|
17
|
-
end
|
18
|
-
|
19
|
-
it "does check if you have a billing address before letting you add shipments" do
|
20
|
-
click_on "Shipments"
|
21
|
-
expect(page).to have_content 'Please fill in customer info'
|
22
|
-
expect(current_path).to eql(spree.edit_admin_order_customer_path(Spree::Order.last))
|
23
|
-
end
|
24
|
-
|
25
|
-
it "completes new order successfully without using the cart", js: true do
|
26
|
-
select2_search product.name, from: Spree.t(:name_or_sku)
|
27
|
-
click_icon :add
|
28
|
-
wait_for_ajax
|
29
|
-
click_on "Customer"
|
30
|
-
select_customer
|
31
|
-
|
32
|
-
check "order_use_billing"
|
33
|
-
fill_in_address
|
34
|
-
click_on "Update"
|
35
|
-
|
36
|
-
click_on "Payments"
|
37
|
-
click_on "Update"
|
38
|
-
|
39
|
-
expect(current_path).to eql(spree.admin_order_payments_path(Spree::Order.last))
|
40
|
-
click_icon "capture"
|
41
|
-
|
42
|
-
click_on "Shipments"
|
43
|
-
click_on "Ship"
|
44
|
-
wait_for_ajax
|
45
|
-
|
46
|
-
expect(page).to have_content("shipped")
|
47
|
-
end
|
48
|
-
|
49
|
-
context "adding new item to the order", js: true do
|
50
|
-
it "inventory items show up just fine and are also registered as shipments" do
|
51
|
-
select2_search product.name, from: Spree.t(:name_or_sku)
|
52
|
-
|
53
|
-
within("table.stock-levels") do
|
54
|
-
fill_in "variant_quantity", with: 2
|
55
|
-
click_icon :add
|
56
|
-
end
|
57
|
-
|
58
|
-
within(".line-items") do
|
59
|
-
expect(page).to have_content(product.name)
|
60
|
-
end
|
61
|
-
|
62
|
-
click_on "Customer"
|
63
|
-
select_customer
|
64
|
-
|
65
|
-
check "order_use_billing"
|
66
|
-
fill_in_address
|
67
|
-
click_on "Update"
|
68
|
-
|
69
|
-
click_on "Shipments"
|
70
|
-
|
71
|
-
within(".stock-contents") do
|
72
|
-
expect(page).to have_content(product.name)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
context "adding new item to the order which isn't available", js: true do
|
78
|
-
before do
|
79
|
-
product.update(available_on: nil)
|
80
|
-
select2_search product.name, from: Spree.t(:name_or_sku)
|
81
|
-
end
|
82
|
-
|
83
|
-
it "inventory items is displayed" do
|
84
|
-
expect(page).to have_content(product.name)
|
85
|
-
expect(page).to have_css('#stock_details')
|
86
|
-
end
|
87
|
-
|
88
|
-
context 'on increase in quantity the product should be removed from order', js: true do
|
89
|
-
before do
|
90
|
-
accept_alert do
|
91
|
-
within("table.stock-levels") do
|
92
|
-
fill_in "variant_quantity", with: 2
|
93
|
-
click_icon :add
|
94
|
-
wait_for_ajax
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
it { expect(page).not_to have_css('#stock_details') }
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
# Regression test for #3958
|
104
|
-
context "without a delivery step", js: true do
|
105
|
-
before do
|
106
|
-
allow(Spree::Order).to receive_messages checkout_step_names: [:address, :payment, :confirm, :complete]
|
107
|
-
end
|
108
|
-
|
109
|
-
it "can still see line items" do
|
110
|
-
select2_search product.name, from: Spree.t(:name_or_sku)
|
111
|
-
click_icon :add
|
112
|
-
within(".line-items") do
|
113
|
-
within(".line-item-name") do
|
114
|
-
expect(page).to have_content(product.name)
|
115
|
-
end
|
116
|
-
within(".line-item-qty-show") do
|
117
|
-
expect(page).to have_content("1")
|
118
|
-
end
|
119
|
-
within(".line-item-price") do
|
120
|
-
expect(page).to have_content(product.price)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
# Regression test for #3336
|
127
|
-
context "start by customer address" do
|
128
|
-
it "completes order fine", js: true do
|
129
|
-
click_on "Customer"
|
130
|
-
select_customer
|
131
|
-
|
132
|
-
check "order_use_billing"
|
133
|
-
fill_in_address
|
134
|
-
click_on "Update"
|
135
|
-
|
136
|
-
click_on "Shipments"
|
137
|
-
select2_search product.name, from: Spree.t(:name_or_sku)
|
138
|
-
click_icon :add
|
139
|
-
wait_for_ajax
|
140
|
-
|
141
|
-
click_on "Payments"
|
142
|
-
click_on "Continue"
|
143
|
-
|
144
|
-
within(".additional-info .state") do
|
145
|
-
expect(page).to have_content("complete")
|
146
|
-
end
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
# Regression test for #5327
|
151
|
-
context "customer with default credit card", js: true do
|
152
|
-
before do
|
153
|
-
allow(Spree.user_class).to receive(:find_by).and_return(user)
|
154
|
-
create(:credit_card, default: true, user: user)
|
155
|
-
end
|
156
|
-
it "transitions to delivery not to complete" do
|
157
|
-
select2_search product.name, from: Spree.t(:name_or_sku)
|
158
|
-
within("table.stock-levels") do
|
159
|
-
fill_in "variant_quantity", with: 1
|
160
|
-
click_icon :add
|
161
|
-
end
|
162
|
-
wait_for_ajax
|
163
|
-
click_link "Customer"
|
164
|
-
select_customer
|
165
|
-
click_button "Update"
|
166
|
-
expect(Spree::Order.last.state).to eq 'delivery'
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
def fill_in_address(kind = "bill")
|
171
|
-
fill_in "First Name", with: "John 99"
|
172
|
-
fill_in "Last Name", with: "Doe"
|
173
|
-
fill_in "Street Address", with: "100 first lane"
|
174
|
-
fill_in "Street Address (cont'd)", with: "#101"
|
175
|
-
fill_in "City", with: "Bethesda"
|
176
|
-
fill_in "Zip", with: "20170"
|
177
|
-
targetted_select2_search state.name, from: "#s2id_order_#{kind}_address_attributes_state_id"
|
178
|
-
fill_in "Phone", with: "123-456-7890"
|
179
|
-
end
|
180
|
-
|
181
|
-
def select_customer
|
182
|
-
within "div#select-customer" do
|
183
|
-
targetted_select2_search user.email, from: "#s2id_customer_search"
|
184
|
-
end
|
185
|
-
end
|
186
|
-
end
|