Sha256: f0458923eea8eda5937fd239574d05945a4bae684fb85d1f64d3b84bdccf3767
Contents?: true
Size: 980 Bytes
Versions: 2
Compression:
Stored size: 980 Bytes
Contents
require 'spec_helper' describe SpreeAvataxOfficial::GetTaxService do subject { described_class.call(order: order) } describe '#call' do let(:order) { create(:avatax_order, line_items_count: 1, ship_address: create(:usa_address)) } context 'with successed response from avatax' do it 'returns success with tax calculated' do VCR.use_cassette('spree_avatax_official/get_tax/sucsess') do result = subject expect(result.success?).to eq true expect(result.value[:taxCalculated]).to eq 0.8 end end end context 'with errors returned from avatax' do let(:order) { create(:order, ship_address: create(:usa_address)) } it 'returns failure with errors' do VCR.use_cassette('spree_avatax_official/get_tax/error') do result = subject expect(result.failure?).to eq true expect(result.value.body['error']).to be_present end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
spree_avatax_official-1.8.0 | spec/services/spree_avatax_official/get_tax_service_spec.rb |
spree_avatax_official-1.7.1 | spec/services/spree_avatax_official/get_tax_service_spec.rb |