mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-22 00:57:26 +00:00
Add missing spec
This commit is contained in:
committed by
Gaetan Craig-Riou
parent
afdb044386
commit
c00e7eeecf
@@ -14,7 +14,7 @@ RSpec.describe Spree::LineItem do
|
||||
it { is_expected.to have_many(:adjustments) }
|
||||
end
|
||||
|
||||
context '#save' do
|
||||
describe '#save' do
|
||||
it 'should update inventory, totals, and tax' do
|
||||
# Regression check for Spree #1481
|
||||
expect(line_item.order).to receive(:create_tax_charge!)
|
||||
@@ -23,7 +23,7 @@ RSpec.describe Spree::LineItem do
|
||||
end
|
||||
end
|
||||
|
||||
context '#destroy' do
|
||||
describe '#destroy' do
|
||||
# Regression test for Spree #1481
|
||||
it "applies tax adjustments" do
|
||||
expect(line_item.order).to receive(:create_tax_charge!)
|
||||
@@ -42,7 +42,7 @@ RSpec.describe Spree::LineItem do
|
||||
end
|
||||
|
||||
# Test for Spree #3391
|
||||
context '#copy_price' do
|
||||
describe '#copy_price' do
|
||||
it "copies over a variant's prices" do
|
||||
line_item.price = nil
|
||||
line_item.currency = nil
|
||||
@@ -54,7 +54,7 @@ RSpec.describe Spree::LineItem do
|
||||
end
|
||||
|
||||
# Test for Spree #3481
|
||||
context '#copy_tax_category' do
|
||||
describe '#copy_tax_category' do
|
||||
it "copies over a variant's tax category" do
|
||||
line_item.tax_category = nil
|
||||
line_item.copy_tax_category
|
||||
@@ -62,7 +62,7 @@ RSpec.describe Spree::LineItem do
|
||||
end
|
||||
end
|
||||
|
||||
context '#full_variant_name' do
|
||||
describe '#full_variant_name' do
|
||||
it "returns variant's full name" do
|
||||
expect(line_item.full_variant_name).to eq(line_item.variant.full_name)
|
||||
end
|
||||
@@ -73,6 +73,17 @@ RSpec.describe Spree::LineItem do
|
||||
end
|
||||
end
|
||||
|
||||
describe '#full_product_name' do
|
||||
it "returns product's full name" do
|
||||
expect(line_item.full_product_name).to eq(line_item.product.name)
|
||||
end
|
||||
|
||||
it "uses product.name when product_name is nil" do
|
||||
line_item.product_name = nil
|
||||
expect(line_item.full_product_name).to eq(line_item.product.name)
|
||||
end
|
||||
end
|
||||
|
||||
describe '.currency' do
|
||||
it 'returns the globally configured currency' do
|
||||
line_item.currency == 'USD'
|
||||
|
||||
Reference in New Issue
Block a user