spec/temp_spec.rb in fossil-0.5.46 vs spec/temp_spec.rb in fossil-0.5.47

- old
+ new

@@ -1,19 +1,24 @@ -require './spec_dbr/spec_helper' +require_relative '../spec_dbr/spec_helper' +#require 'spec_helper' describe "FOS Licensing" do before :all do -# set_fos_db([UserInformation, Aircraft]) -# set_dbr_db([TripLeg, FlightLogExpense, Aircraft]) - db = Sequel.mysql(:username => 'datamart', :password => 'datap@ss', :adapter => 'mysql', :host => 'hrkdm', :database => 'dbr') +# set_fos_db([TripLeg, FlightLogExpense, Vendor, AirportFbo]) +# set_dbr_db([TripLeg, FlightLogExpense, Aircraft, Vendor, AirportFbo]) + db = Sequel.fos_dbr(:username => 'datamart', :password => 'datap@ss', :adapter => 'mysql', :host => 'hrkdm', :database => 'dbr') db.loggers=[Logger.new($stdout)] - TripLeg.db = db - FlightLogExpense.db = db + [TripLeg, FlightLogExpense, Aircraft, Vendor, AirportFbo, AirportFuel].each { |m| m.db = db } end it "puts the lotion on the skin" do - p TripLeg.filter(:'trip number' => 68562, :'leg number' => 1).eager_graph(:fuel_expenses).first + legs = TripLeg.fuel_passdown_data(Date.parse('2011-02-06'), Date.parse('2011-02-06'), ["SIGNATURE FLIGHT SUPPORT"]) + p "BLAH BLAH BLAH" + pp legs +# l = TripLeg.filter(:'trip number' => 68562, :'leg number' => 1).eager_graph(:flight_log_expenses => :vendor).all.first +# p "BLAH BLAH BLAH BLAH" +# p l.fuel_expenses.first.vendor # p FlightLogExpense.where(:trip_leg_id => "SEMJ-3-17-39922-1258", :type => 1) # tl = TripLeg.filter(:trip_number=>68562, :leg_number =>1).first # tl = TripLeg.filter(:trip_number => 68562, :leg_number => 1).eager_graph(:fuel_expenses).select_fields(:self => [:trip_number, :leg_number], :fuel_expenses => [:type]).all # tl = TripLeg.filter(:trip_number => 68562, :leg_number => 1).eager_graph(:aircraft).select_fields(:self => [:trip_number, :leg_number], :aircraft => [:tail_number]).all \ No newline at end of file