spec/temp_spec.rb in fossil-0.5.49 vs spec/temp_spec.rb in fossil-0.5.50

- old
+ new

@@ -1,28 +1,33 @@ -#require_relative '../spec_dbr/spec_helper' -require 'spec_helper' +require_relative '../spec_dbr/spec_helper' +#require 'spec_helper' describe "FOS Licensing" do before :all do - set_fos_db([CityPair]) -# 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, FlightLogExpense, Aircraft, Vendor, AirportFbo, AirportFuel].each { |m| m.db = db } + #set_fos_db([CityPair]) + #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, FlightLogExpense, Aircraft, Vendor, AirportFbo, AirportFuel].each { |m| m.db = db } end - it "exports the fos city pairs table" do - File.open("city_pairs.csv", "w") do |f| - csv = "" - attributes = CityPair.first.keys - csv << attributes.to_flat_file_row( :delimeter => ',', :enclosed_by => '"') + "\n" - - CityPair.find_all.each do |cp| - csv << attributes.inject("") {|str, attr| str << "\"#{cp.send(attr)}\"," }.chop + "\n" - end - f.print(csv) - end + it "trip leg can get its aircraft tail number" do + l = TripLeg.filter(:trip_number => 68562, :leg_number => 1).first + p l.tail_number end + + #it "exports the fos city pairs table" do + #File.open("city_pairs.csv", "w") do |f| + #csv = "" + #attributes = CityPair.first.keys + #csv << attributes.to_flat_file_row( :delimeter => ',', :enclosed_by => '"') + "\n" + + #CityPair.find_all.each do |cp| + #csv << attributes.inject("") {|str, attr| str << "\"#{cp.send(attr)}\"," }.chop + "\n" + #end + #f.print(csv) + #end + #end #it "pass a block to include?" do #fbos = ["ATLANTIC AVIATION SERVIC", "SIGNATURE FLIGHT SUPPORT", "LANDMARK AVIATION"] #search = "LANDMARK AVIATION EAST"