spree_core 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spree/core/version.rb +1 -1
- data/spree_core.gemspec +1 -1
- metadata +3 -206
- data/spec/fixtures/microdata.html +0 -22
- data/spec/fixtures/microdata_itemref.html +0 -15
- data/spec/fixtures/microdata_no_itemscope.html +0 -20
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spec/helpers/base_helper_spec.rb +0 -200
- data/spec/helpers/products_helper_spec.rb +0 -289
- data/spec/lib/calculated_adjustments_spec.rb +0 -7
- data/spec/lib/i18n_spec.rb +0 -123
- data/spec/lib/search/base_spec.rb +0 -86
- data/spec/lib/spree/core/controller_helpers/auth_spec.rb +0 -103
- data/spec/lib/spree/core/controller_helpers/order_spec.rb +0 -110
- data/spec/lib/spree/core/controller_helpers/search_spec.rb +0 -17
- data/spec/lib/spree/core/controller_helpers/store_spec.rb +0 -72
- data/spec/lib/spree/core/controller_helpers/strong_parameters_spec.rb +0 -39
- data/spec/lib/spree/core/delegate_belongs_to_spec.rb +0 -22
- data/spec/lib/spree/core/importer/order_spec.rb +0 -605
- data/spec/lib/spree/core/number_generator_spec.rb +0 -175
- data/spec/lib/spree/core/token_generator_spec.rb +0 -24
- data/spec/lib/spree/core/validators/email_spec.rb +0 -53
- data/spec/lib/spree/core_spec.rb +0 -23
- data/spec/lib/spree/localized_number_spec.rb +0 -48
- data/spec/lib/spree/migrations_spec.rb +0 -36
- data/spec/lib/spree/money_spec.rb +0 -122
- data/spec/lib/tasks/exchanges_spec.rb +0 -136
- data/spec/mailers/order_mailer_spec.rb +0 -122
- data/spec/mailers/reimbursement_mailer_spec.rb +0 -47
- data/spec/mailers/shipment_mailer_spec.rb +0 -81
- data/spec/mailers/test_mailer_spec.rb +0 -38
- data/spec/models/option_type_prototype_spec.rb +0 -9
- data/spec/models/spree/ability_spec.rb +0 -251
- data/spec/models/spree/address_spec.rb +0 -402
- data/spec/models/spree/adjustable/adjuster/base_spec.rb +0 -10
- data/spec/models/spree/adjustable/adjuster/promotion_spec.rb +0 -211
- data/spec/models/spree/adjustable/adjuster/tax_spec.rb +0 -86
- data/spec/models/spree/adjustable/adjustments_updater_spec.rb +0 -26
- data/spec/models/spree/adjustment_spec.rb +0 -189
- data/spec/models/spree/app_configuration_spec.rb +0 -26
- data/spec/models/spree/asset_spec.rb +0 -28
- data/spec/models/spree/calculator/default_tax_spec.rb +0 -152
- data/spec/models/spree/calculator/flat_percent_item_total_spec.rb +0 -25
- data/spec/models/spree/calculator/flat_rate_spec.rb +0 -47
- data/spec/models/spree/calculator/flexi_rate_spec.rb +0 -41
- data/spec/models/spree/calculator/percent_on_line_item_spec.rb +0 -15
- data/spec/models/spree/calculator/price_sack_spec.rb +0 -30
- data/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb +0 -47
- data/spec/models/spree/calculator/shipping.rb +0 -8
- data/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb +0 -23
- data/spec/models/spree/calculator/shipping/flat_rate_spec.rb +0 -13
- data/spec/models/spree/calculator/shipping/flexi_rate_spec.rb +0 -52
- data/spec/models/spree/calculator/shipping/per_item_spec.rb +0 -20
- data/spec/models/spree/calculator/shipping/price_sack_spec.rb +0 -29
- data/spec/models/spree/calculator/tiered_flat_rate_spec.rb +0 -40
- data/spec/models/spree/calculator/tiered_percent_spec.rb +0 -51
- data/spec/models/spree/calculator_spec.rb +0 -69
- data/spec/models/spree/classification_spec.rb +0 -93
- data/spec/models/spree/concerns/display_money_spec.rb +0 -43
- data/spec/models/spree/concerns/user_methods_spec.rb +0 -82
- data/spec/models/spree/concerns/vat_price_calculation_spec.rb +0 -66
- data/spec/models/spree/country_spec.rb +0 -55
- data/spec/models/spree/credit_card_spec.rb +0 -328
- data/spec/models/spree/customer_return_spec.rb +0 -240
- data/spec/models/spree/exchange_spec.rb +0 -75
- data/spec/models/spree/gateway/bogus_simple.rb +0 -20
- data/spec/models/spree/gateway/bogus_spec.rb +0 -13
- data/spec/models/spree/gateway_spec.rb +0 -61
- data/spec/models/spree/image_spec.rb +0 -8
- data/spec/models/spree/inventory_unit_spec.rb +0 -256
- data/spec/models/spree/line_item_spec.rb +0 -346
- data/spec/models/spree/option_type_spec.rb +0 -14
- data/spec/models/spree/option_value_spec.rb +0 -18
- data/spec/models/spree/order/address_spec.rb +0 -50
- data/spec/models/spree/order/adjustments_spec.rb +0 -29
- data/spec/models/spree/order/callbacks_spec.rb +0 -42
- data/spec/models/spree/order/checkout_spec.rb +0 -770
- data/spec/models/spree/order/currency_updater_spec.rb +0 -32
- data/spec/models/spree/order/finalizing_spec.rb +0 -114
- data/spec/models/spree/order/helpers_spec.rb +0 -5
- data/spec/models/spree/order/payment_spec.rb +0 -214
- data/spec/models/spree/order/risk_assessment_spec.rb +0 -84
- data/spec/models/spree/order/shipments_spec.rb +0 -43
- data/spec/models/spree/order/state_machine_spec.rb +0 -212
- data/spec/models/spree/order/store_credit_spec.rb +0 -426
- data/spec/models/spree/order/tax_spec.rb +0 -84
- data/spec/models/spree/order/totals_spec.rb +0 -24
- data/spec/models/spree/order/updating_spec.rb +0 -18
- data/spec/models/spree/order/validations_spec.rb +0 -15
- data/spec/models/spree/order_contents_spec.rb +0 -297
- data/spec/models/spree/order_inventory_spec.rb +0 -239
- data/spec/models/spree/order_merger_spec.rb +0 -135
- data/spec/models/spree/order_spec.rb +0 -1046
- data/spec/models/spree/order_updater_spec.rb +0 -305
- data/spec/models/spree/payment/gateway_options_spec.rb +0 -127
- data/spec/models/spree/payment/store_credit_spec.rb +0 -60
- data/spec/models/spree/payment_method/store_credit_spec.rb +0 -291
- data/spec/models/spree/payment_method_spec.rb +0 -103
- data/spec/models/spree/payment_spec.rb +0 -919
- data/spec/models/spree/preference_spec.rb +0 -80
- data/spec/models/spree/preferences/configuration_spec.rb +0 -30
- data/spec/models/spree/preferences/preferable_spec.rb +0 -344
- data/spec/models/spree/preferences/scoped_store_spec.rb +0 -58
- data/spec/models/spree/preferences/store_spec.rb +0 -46
- data/spec/models/spree/price_spec.rb +0 -128
- data/spec/models/spree/product/scopes_spec.rb +0 -183
- data/spec/models/spree/product_duplicator_spec.rb +0 -103
- data/spec/models/spree/product_filter_spec.rb +0 -26
- data/spec/models/spree/product_option_type_spec.rb +0 -9
- data/spec/models/spree/product_promotion_rule_spec.rb +0 -9
- data/spec/models/spree/product_property_spec.rb +0 -26
- data/spec/models/spree/product_spec.rb +0 -629
- data/spec/models/spree/promotion/actions/create_adjustment_spec.rb +0 -113
- data/spec/models/spree/promotion/actions/create_item_adjustments_spec.rb +0 -148
- data/spec/models/spree/promotion/actions/create_line_items_spec.rb +0 -86
- data/spec/models/spree/promotion/actions/free_shipping_spec.rb +0 -36
- data/spec/models/spree/promotion/rules/country_spec.rb +0 -36
- data/spec/models/spree/promotion/rules/first_order_spec.rb +0 -75
- data/spec/models/spree/promotion/rules/item_total_spec.rb +0 -282
- data/spec/models/spree/promotion/rules/one_use_per_user_spec.rb +0 -42
- data/spec/models/spree/promotion/rules/option_value_spec.rb +0 -90
- data/spec/models/spree/promotion/rules/product_spec.rb +0 -143
- data/spec/models/spree/promotion/rules/taxon_spec.rb +0 -102
- data/spec/models/spree/promotion/rules/user_logged_in_spec.rb +0 -27
- data/spec/models/spree/promotion/rules/user_spec.rb +0 -45
- data/spec/models/spree/promotion_action_spec.rb +0 -10
- data/spec/models/spree/promotion_category_spec.rb +0 -17
- data/spec/models/spree/promotion_handler/cart_spec.rb +0 -102
- data/spec/models/spree/promotion_handler/coupon_spec.rb +0 -323
- data/spec/models/spree/promotion_handler/free_shipping_spec.rb +0 -48
- data/spec/models/spree/promotion_handler/page_spec.rb +0 -44
- data/spec/models/spree/promotion_rule_spec.rb +0 -29
- data/spec/models/spree/promotion_rule_taxon_spec.rb +0 -9
- data/spec/models/spree/promotion_rule_user_spec.rb +0 -9
- data/spec/models/spree/promotion_spec.rb +0 -679
- data/spec/models/spree/property_prototype_spec.rb +0 -9
- data/spec/models/spree/property_spec.rb +0 -5
- data/spec/models/spree/prototype_spec.rb +0 -5
- data/spec/models/spree/prototype_taxon_spec.rb +0 -9
- data/spec/models/spree/refund_reason_spec.rb +0 -20
- data/spec/models/spree/refund_spec.rb +0 -195
- data/spec/models/spree/reimbursement/credit_spec.rb +0 -36
- data/spec/models/spree/reimbursement/reimbursement_type_engine_spec.rb +0 -140
- data/spec/models/spree/reimbursement/reimbursement_type_validator_spec.rb +0 -83
- data/spec/models/spree/reimbursement_performer_spec.rb +0 -30
- data/spec/models/spree/reimbursement_spec.rb +0 -188
- data/spec/models/spree/reimbursement_tax_calculator_spec.rb +0 -63
- data/spec/models/spree/reimbursement_type/credit_spec.rb +0 -53
- data/spec/models/spree/reimbursement_type/exchange_spec.rb +0 -46
- data/spec/models/spree/reimbursement_type/original_payment_spec.rb +0 -55
- data/spec/models/spree/reimbursement_type/store_credit_spec.rb +0 -101
- data/spec/models/spree/return_authorization_reason_spec.rb +0 -7
- data/spec/models/spree/return_authorization_spec.rb +0 -230
- data/spec/models/spree/return_item/eligibility_validator/default_spec.rb +0 -77
- data/spec/models/spree/return_item/eligibility_validator/inventory_shipped_spec.rb +0 -58
- data/spec/models/spree/return_item/eligibility_validator/no_reimbursements_spec.rb +0 -61
- data/spec/models/spree/return_item/eligibility_validator/order_completed_spec.rb +0 -32
- data/spec/models/spree/return_item/eligibility_validator/rma_required_spec.rb +0 -29
- data/spec/models/spree/return_item/eligibility_validator/time_since_purchase_spec.rb +0 -35
- data/spec/models/spree/return_item/exchange_variant_eligibility/same_option_value_spec.rb +0 -65
- data/spec/models/spree/return_item/exchange_variant_eligibility/same_product_spec.rb +0 -43
- data/spec/models/spree/return_item_spec.rb +0 -731
- data/spec/models/spree/returns_calculator_spec.rb +0 -14
- data/spec/models/spree/role_spec.rb +0 -7
- data/spec/models/spree/shipment_spec.rb +0 -742
- data/spec/models/spree/shipping_calculator_spec.rb +0 -45
- data/spec/models/spree/shipping_category_spec.rb +0 -19
- data/spec/models/spree/shipping_method_spec.rb +0 -95
- data/spec/models/spree/shipping_rate_spec.rb +0 -140
- data/spec/models/spree/state_spec.rb +0 -29
- data/spec/models/spree/stock/availability_validator_spec.rb +0 -36
- data/spec/models/spree/stock/content_item_spec.rb +0 -31
- data/spec/models/spree/stock/coordinator_spec.rb +0 -61
- data/spec/models/spree/stock/differentiator_spec.rb +0 -39
- data/spec/models/spree/stock/estimator_spec.rb +0 -202
- data/spec/models/spree/stock/inventory_unit_builder_spec.rb +0 -38
- data/spec/models/spree/stock/package_spec.rb +0 -182
- data/spec/models/spree/stock/packer_spec.rb +0 -70
- data/spec/models/spree/stock/prioritizer_spec.rb +0 -125
- data/spec/models/spree/stock/quantifier_spec.rb +0 -126
- data/spec/models/spree/stock/splitter/backordered_spec.rb +0 -29
- data/spec/models/spree/stock/splitter/base_spec.rb +0 -21
- data/spec/models/spree/stock/splitter/shipping_category_spec.rb +0 -47
- data/spec/models/spree/stock/splitter/weight_spec.rb +0 -32
- data/spec/models/spree/stock_item_spec.rb +0 -432
- data/spec/models/spree/stock_location_spec.rb +0 -243
- data/spec/models/spree/stock_movement_spec.rb +0 -120
- data/spec/models/spree/stock_transfer_spec.rb +0 -50
- data/spec/models/spree/store_credit_event_spec.rb +0 -101
- data/spec/models/spree/store_credit_spec.rb +0 -786
- data/spec/models/spree/store_spec.rb +0 -78
- data/spec/models/spree/tax_category_spec.rb +0 -32
- data/spec/models/spree/tax_rate_spec.rb +0 -561
- data/spec/models/spree/taxon_spec.rb +0 -85
- data/spec/models/spree/taxonomy_spec.rb +0 -18
- data/spec/models/spree/tracker_spec.rb +0 -21
- data/spec/models/spree/user_spec.rb +0 -203
- data/spec/models/spree/variant_spec.rb +0 -818
- data/spec/models/spree/zone_member_spec.rb +0 -38
- data/spec/models/spree/zone_spec.rb +0 -472
- data/spec/spec_helper.rb +0 -79
- data/spec/support/big_decimal.rb +0 -5
- data/spec/support/concerns/adjustment_source.rb +0 -23
- data/spec/support/concerns/default_price.rb +0 -37
- data/spec/support/rake.rb +0 -13
- data/spec/support/test_gateway.rb +0 -2
data/spec/spec_helper.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
if ENV["COVERAGE"]
|
2
|
-
# Run Coverage report
|
3
|
-
require 'simplecov'
|
4
|
-
SimpleCov.start do
|
5
|
-
add_group 'Controllers', 'app/controllers'
|
6
|
-
add_group 'Helpers', 'app/helpers'
|
7
|
-
add_group 'Mailers', 'app/mailers'
|
8
|
-
add_group 'Models', 'app/models'
|
9
|
-
add_group 'Views', 'app/views'
|
10
|
-
add_group 'Jobs', 'app/jobs'
|
11
|
-
add_group 'Libraries', 'lib'
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
16
|
-
# from the project root directory.
|
17
|
-
ENV["RAILS_ENV"] ||= 'test'
|
18
|
-
|
19
|
-
begin
|
20
|
-
require File.expand_path("../dummy/config/environment", __FILE__)
|
21
|
-
rescue LoadError
|
22
|
-
puts "Could not load dummy application. Please ensure you have run `bundle exec rake test_app`"
|
23
|
-
end
|
24
|
-
|
25
|
-
require 'rspec/rails'
|
26
|
-
require 'database_cleaner'
|
27
|
-
require 'ffaker'
|
28
|
-
|
29
|
-
Dir["./spec/support/**/*.rb"].sort.each { |f| require f }
|
30
|
-
|
31
|
-
if ENV["CHECK_TRANSLATIONS"]
|
32
|
-
require "spree/testing_support/i18n"
|
33
|
-
end
|
34
|
-
|
35
|
-
require 'spree/testing_support/factories'
|
36
|
-
require 'spree/testing_support/preferences'
|
37
|
-
require 'spree/testing_support/shoulda_matcher_configuration'
|
38
|
-
require 'spree/testing_support/url_helpers'
|
39
|
-
require 'spree/testing_support/kernel'
|
40
|
-
|
41
|
-
RSpec.configure do |config|
|
42
|
-
config.color = true
|
43
|
-
config.fail_fast = ENV['FAIL_FAST'] || false
|
44
|
-
config.fixture_path = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures")
|
45
|
-
config.infer_spec_type_from_file_location!
|
46
|
-
config.mock_with :rspec
|
47
|
-
config.raise_errors_for_deprecations!
|
48
|
-
|
49
|
-
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
50
|
-
# examples within a transaction, comment the following line or assign false
|
51
|
-
# instead of true.
|
52
|
-
config.use_transactional_fixtures = true
|
53
|
-
|
54
|
-
config.before :each do
|
55
|
-
Rails.cache.clear
|
56
|
-
reset_spree_preferences
|
57
|
-
end
|
58
|
-
|
59
|
-
config.extend WithModel
|
60
|
-
|
61
|
-
config.include FactoryGirl::Syntax::Methods
|
62
|
-
config.include Spree::TestingSupport::Preferences
|
63
|
-
config.include Spree::TestingSupport::Kernel
|
64
|
-
|
65
|
-
# Clean out the database state before the tests run
|
66
|
-
config.before(:suite) do
|
67
|
-
DatabaseCleaner.clean_with(:truncation)
|
68
|
-
DatabaseCleaner.strategy = :transaction
|
69
|
-
end
|
70
|
-
|
71
|
-
# Wrap all db isolated tests in a transaction
|
72
|
-
config.around(db: :isolate) do |example|
|
73
|
-
DatabaseCleaner.cleaning(&example)
|
74
|
-
end
|
75
|
-
|
76
|
-
config.around do |example|
|
77
|
-
Timeout.timeout(30, &example)
|
78
|
-
end
|
79
|
-
end
|
data/spec/support/big_decimal.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
shared_examples_for "an adjustment source" do
|
2
|
-
subject(:source) { described_class.create }
|
3
|
-
|
4
|
-
before do
|
5
|
-
allow(Spree::Adjustable::AdjustmentsUpdater).to receive(:update)
|
6
|
-
order.adjustments.create(order: order, amount: 10, label: 'Adjustment', source: source)
|
7
|
-
end
|
8
|
-
|
9
|
-
describe '#destroy' do
|
10
|
-
before { source.destroy }
|
11
|
-
|
12
|
-
context 'when order incomplete' do
|
13
|
-
let(:order) { create(:order_with_line_items) }
|
14
|
-
it { expect(order.adjustments.count).to eq(0) }
|
15
|
-
end
|
16
|
-
|
17
|
-
context 'when order is complete' do
|
18
|
-
let(:order) { create(:completed_order_with_totals) }
|
19
|
-
it { expect(order.adjustments.count).to eq(1) }
|
20
|
-
it { expect(order.adjustments.reload.first.source).to be_nil }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
shared_examples_for "default_price" do
|
2
|
-
let(:model) { described_class }
|
3
|
-
subject(:instance) { FactoryGirl.build(model.name.demodulize.downcase.to_sym) }
|
4
|
-
|
5
|
-
describe '.has_one :default_price' do
|
6
|
-
let(:default_price_association) { model.reflect_on_association(:default_price) }
|
7
|
-
|
8
|
-
it 'should be a has one association' do
|
9
|
-
expect(default_price_association.macro).to eql :has_one
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should have a dependent destroy' do
|
13
|
-
expect(default_price_association.options[:dependent]).to eql :destroy
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'should have the class name of Spree::Price' do
|
17
|
-
expect(default_price_association.options[:class_name]).to eql 'Spree::Price'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '#default_price' do
|
22
|
-
subject { instance.default_price }
|
23
|
-
|
24
|
-
its(:class) { should eql Spree::Price }
|
25
|
-
it 'delegates price' do
|
26
|
-
expect(instance.default_price). to receive(:price)
|
27
|
-
instance.price
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'delegates price_including_vat_for' do
|
31
|
-
expect(instance.default_price). to receive(:price_including_vat_for)
|
32
|
-
instance.price_including_vat_for
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
its(:has_default_price?) { should be_truthy }
|
37
|
-
end
|
data/spec/support/rake.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require "rake"
|
2
|
-
|
3
|
-
shared_context "rake" do
|
4
|
-
let(:task_name) { self.class.top_level_description }
|
5
|
-
let(:task_path) { "lib/tasks/#{task_name.split(":").first}" }
|
6
|
-
subject { Rake::Task[task_name] }
|
7
|
-
|
8
|
-
before do
|
9
|
-
Rake::Task.define_task(:environment)
|
10
|
-
load File.expand_path(Rails.root + "../../#{task_path}.rake")
|
11
|
-
subject.reenable
|
12
|
-
end
|
13
|
-
end
|