Sha256: 5373204e2f8de6675338a22ed56e2c90c0fa754cd4b1849367ea44be898c9e82

Contents?: true

Size: 1.45 KB

Versions: 4

Compression:

Stored size: 1.45 KB

Contents

require 'spec_helper'

describe "parsing a CH.csv file" do
  it "uses the correct version" do
    lambda { EfoNelfo.load(csv('C4.V3.csv')) }.must_raise EfoNelfo::UnsupportedPostType
  end

  it "parses the file and returns an OrderConfirmation" do
    order = EfoNelfo.load(csv('C450517.032.csv'))
    order.must_be_instance_of EfoNelfo::V40::CH
    order.post_type.must_equal "CH"
    order.format.must_equal "EFONELFO"
    order.version.must_equal "4.0"

    order.BekreftelseNr.must_equal "52104503D0001"
    order.SOrdNr.must_equal "52104503D"
    order.BestNr.must_equal "BE0000 23"
    order.KundeNr.must_equal "2110310"
    order.KjøpersRef.must_equal "Knut"
    order.SelgersRef.must_equal "Ole N."
    order.Merket.must_equal "BE2/2"
    order.TransportMåte.must_equal "ROAD"
    order.Melding.must_equal "Ring Jacob 92413009"
    order.LevDato.to_s.must_equal "2005-04-25"
  end

  it "the order confirmation contains orderlines" do
    order = EfoNelfo.load(csv('C450517.032.csv'))

    line = order.lines[1]
    line.must_be_instance_of EfoNelfo::V40::CL
    line.post_type.must_equal "CL"
    line.index_seller.must_equal 30
    line.index_buyer.must_equal 3
    line.VareNr.must_equal "1261190"
    line.VaBetg.must_equal "INNSTIKK-KLEMME 2X2,5MM2 WAGO"
    line.Ant.must_equal 3000
    line.Lev.must_equal 2000
    line.Rest.must_equal 1000
    line.PrisEnhet.must_equal "EA"
    line.RLevDato.to_s.must_equal "2005-05-02"
    line.EnhetsPris.must_equal 8000
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
efo_nelfo-2.0.0 spec/parsing/ch_spec.rb
efo_nelfo-1.7.0 spec/parsing/ch_spec.rb
efo_nelfo-1.6.2 spec/parsing/ch_spec.rb
efo_nelfo-1.6.1 spec/parsing/ch_spec.rb