Sha256: 2ceef31ca063dc7a2f41ea7c6cdaddafca37e4a60ec5ef536eba4cd4a85e5dfc

Contents?: true

Size: 646 Bytes

Versions: 33

Compression:

Stored size: 646 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)
    mock(Code).valid_value_for_group?(254, :aircraft_document) {true}
    doc = VendorDocument.new(:file_name_prefix=>"TRIP", :file_name=>"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 == 254
  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
fossil-0.3.49 spec/models/trip_spec.rb
fossil-0.3.48 spec/models/trip_spec.rb
fossil-0.3.47 spec/models/trip_spec.rb
fossil-0.3.46 spec/models/trip_spec.rb
fossil-0.3.45 spec/models/trip_spec.rb
fossil-0.3.44 spec/models/trip_spec.rb
fossil-0.3.43 spec/models/trip_spec.rb
fossil-0.3.42 spec/models/trip_spec.rb
fossil-0.3.41 spec/models/trip_spec.rb
fossil-0.3.40 spec/models/trip_spec.rb
fossil-0.3.39 spec/models/trip_spec.rb
fossil-0.3.38 spec/models/trip_spec.rb
fossil-0.3.37 spec/models/trip_spec.rb
fossil-0.3.36 spec/models/trip_spec.rb
fossil-0.3.35 spec/models/trip_spec.rb
fossil-0.3.34 spec/models/trip_spec.rb
fossil-0.3.33 spec/models/trip_spec.rb
fossil-0.3.32 spec/models/trip_spec.rb
fossil-0.3.31 spec/models/trip_spec.rb
fossil-0.3.30 spec/models/trip_spec.rb