diff --git a/lib/oddb2xml/extractor.rb b/lib/oddb2xml/extractor.rb index 8aa45ad..095811a 100644 --- a/lib/oddb2xml/extractor.rb +++ b/lib/oddb2xml/extractor.rb @@ -490,7 +490,7 @@ def to_hash :line => line.chomp, :ean => ean13, :vat => line[96], - :description => line[10..59], # .sub(/\s+$/, ''), + :description => line[10..59].sub(/\s+$/, ''), :additional_desc => '', :pharmacode => pharma_code, :price => sprintf("%.2f", line[60,6].gsub(/(\d{2})$/, '.\1').to_f), diff --git a/spec/extractor_spec.rb b/spec/extractor_spec.rb index b6434e6..b1f24dd 100644 --- a/spec/extractor_spec.rb +++ b/spec/extractor_spec.rb @@ -186,5 +186,6 @@ end #it { expect(subject.to_hash.keys.first).to eq("7680316950157") } it "should set the correct SALECD cmut code" do expect(subject.to_hash.values.first[:cmut]).to eq("3") end + it "should set the correct SALECD description" do expect(subject.to_hash.values.first[:description]).to eq("SOFRADEX Gtt Auric 8 ml") end end end