diff --git a/common_spree_dependencies.rb b/common_spree_dependencies.rb index c43b92020b1..d69d9fe4b2f 100644 --- a/common_spree_dependencies.rb +++ b/common_spree_dependencies.rb @@ -23,7 +23,7 @@ gem 'capybara-screenshot' gem 'database_cleaner', '~> 1.3' gem 'email_spec' - gem 'factory_girl_rails', '~> 4.5.0' + gem 'factory_girl_rails', '~> 4.8' gem 'launchy' gem 'rspec-activemodel-mocks', '~>1.0.2' gem 'rspec-collection_matchers' diff --git a/core/spec/models/spree/order_spec.rb b/core/spec/models/spree/order_spec.rb index 3ca98d388a0..c59a1235719 100644 --- a/core/spec/models/spree/order_spec.rb +++ b/core/spec/models/spree/order_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' describe Spree::Order, type: :model do - let(:store) { build_stubbed(:store) } - let(:user) { stub_model(Spree::LegacyUser, email: "spree@example.com") } - let(:order) { stub_model(Spree::Order, user: user, store: store) } + let(:store) { create(:store) } + let(:user) { create(:user, email: "spree@example.com") } + let(:order) { create(:order, user: user, store: store) } before do allow(Spree::LegacyUser).to receive_messages(current: mock_model(Spree::LegacyUser, id: 123)) @@ -680,6 +680,8 @@ def merge!(other_order, user = nil) end context "#generate_order_number" do + let(:order) { build(:order) } + context "when no configure" do let(:default_length) { Spree::Order::ORDER_NUMBER_LENGTH + Spree::Order::ORDER_NUMBER_PREFIX.length } subject(:order_number) { order.generate_order_number } diff --git a/core/spec/models/spree/tax/item_adjuster_spec.rb b/core/spec/models/spree/tax/item_adjuster_spec.rb index 3a9f1181e78..d1282eae97c 100644 --- a/core/spec/models/spree/tax/item_adjuster_spec.rb +++ b/core/spec/models/spree/tax/item_adjuster_spec.rb @@ -50,7 +50,7 @@ def tax_adjustments end context 'when the order has a taxable address' do - let(:item) { build_stubbed :line_item, order: order } + let(:item) { create :line_item, order: order } let(:address) { order.tax_address } before do @@ -65,8 +65,8 @@ def tax_adjustments context 'when there are matching rates for the zone' do context 'and all rates have the same tax category as the item' do - let(:item) { build_stubbed :line_item, order: order, tax_category: item_tax_category } - let(:item_tax_category) { build_stubbed(:tax_category) } + let(:item) { create :line_item, order: order, tax_category: item_tax_category } + let(:item_tax_category) { create(:tax_category) } let(:rate_1) { create :tax_rate, tax_category: item_tax_category } let(:rate_2) { create :tax_rate } let(:rates_for_order_zone) { [rate_1, rate_2] }