Sha256: 0103aeb9c89892ff294370fa77bb6b4123708aa3d39fbfd5bf71471dc7776223

Contents?: true

Size: 713 Bytes

Versions: 18

Compression:

Stored size: 713 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Trip" do
  
  before do
    stub_save_for_model(VendorDocument)
  end

  it "creates a vendor document attachment" do
    trip = Trip.new(:kid_date=>1,:kid_time=>2,:kid_user=>3,:kid_mult=>4,:kid_comm=>5)
    arr = []
    mock(VendorDocument).get_all_types {arr}
    mock(arr).find {OpenStruct.new(:value=>"fake_doc_type")}
    doc = VendorDocument.new(:doc_filename_prefix=>"TRIP", :doc_filename=>"whatever", :doc_type_value=> 254, :trip_number=>111)
    doc.save()
    trip.add_attachment(doc)
    doc.kid_user.should == "ADMN"
    doc.image_name.should == "TRIP/whatever"
    doc.document_type.should == "fake_doc_type"
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
fossil-0.3.16 spec/models/trip_spec.rb
fossil-0.3.15 spec/models/trip_spec.rb
fossil-0.3.14 spec/models/trip_spec.rb
fossil-0.3.13 spec/models/trip_spec.rb
fossil-0.3.12 spec/models/trip_spec.rb
fossil-0.3.11 spec/models/trip_spec.rb
fossil-0.3.10 spec/models/trip_spec.rb
fossil-0.3.9 spec/models/trip_spec.rb
fossil-0.3.8 spec/models/trip_spec.rb
fossil-0.3.7 spec/models/trip_spec.rb
fossil-0.3.6 spec/models/trip_spec.rb
fossil-0.3.5 spec/models/trip_spec.rb
fossil-0.3.4 spec/models/trip_spec.rb
fossil-0.3.3 spec/models/trip_spec.rb
fossil-0.3.2 spec/models/trip_spec.rb
fossil-0.3.1 spec/models/trip_spec.rb
fossil-0.3.0 spec/models/trip_spec.rb
fossil-0.2.9 spec/models/trip_spec.rb