Sha256: ba21224d9bf05886c6bfe837db33256d3c03b5d70d438c8d94ace169ce1890cb
Contents?: true
Size: 1.12 KB
Versions: 15
Compression:
Stored size: 1.12 KB
Contents
require 'spec_helper' describe BrDanfe::Danfe do let(:xml) do <<~XML <nfeProc> <NFe> <infNFe> <ide> <mod>#{mod}</mod> <NFref> <refNFP> <mod>04</mod> </refNFP> </NFref> </ide> </infNFe> </NFe> </nfeProc> XML end subject { described_class.new(xml) } context 'xmls parameter' do let(:mod) { 55 } it 'accepts one xml' do subject = described_class.new(xml) expect(subject.class).to eq BrDanfe::DanfeLib::Nfe end it 'accepts an array of xmls' do subject = described_class.new([xml, xml]) expect(subject.class).to eq BrDanfe::DanfeLib::Nfe end end context 'when the xml document type is NF-e' do let(:mod) { 55 } it 'returns a NF-e danfe class' do expect(subject.class).to eq BrDanfe::DanfeLib::Nfe end end context 'when the xml document type is NFC-e' do let(:mod) { 65 } it 'returns a NFC-e danfe class' do expect(subject.class).to eq BrDanfe::DanfeLib::Nfce end end end
Version data entries
15 entries across 15 versions & 1 rubygems