diff options
| author | Marc Florisson | 2013-07-23 09:43:31 +0200 | 
|---|---|---|
| committer | Marc Florisson | 2013-07-23 09:43:31 +0200 | 
| commit | e40a44ffdb011bd1fae6d8e3960570f6222d3994 (patch) | |
| tree | 8e19b0f165934812fe3dc01f9296318ba8abfb7e | |
| parent | 59f686b05bd0bd98fb10c39f19074e7261f75a76 (diff) | |
| download | chouette-core-e40a44ffdb011bd1fae6d8e3960570f6222d3994.tar.bz2 | |
fix models select to export
| -rw-r--r-- | app/exporters/chouette/kml/exporter.rb | 6 | ||||
| -rw-r--r-- | spec/exporters/chouette/kml/exporter_spec.rb | 21 | 
2 files changed, 15 insertions, 12 deletions
| diff --git a/app/exporters/chouette/kml/exporter.rb b/app/exporters/chouette/kml/exporter.rb index 046d5d29f..aca4a1d09 100644 --- a/app/exporters/chouette/kml/exporter.rb +++ b/app/exporters/chouette/kml/exporter.rb @@ -43,14 +43,14 @@ class Chouette::Kml::Exporter          Chouette::Kml::StopAreaExporter.save( stop_areas, temp_dir, kml_export, "Quay")          commercial_stop_areas = lines_collected.collect(&:commercial_stop_areas).flatten.uniq.sort_by(&:name) -        Chouette::Kml::StopAreaExporter.save( stop_areas, temp_dir, kml_export, "CommercialStopPoint") +        Chouette::Kml::StopAreaExporter.save( commercial_stop_areas, temp_dir, kml_export, "CommercialStopPoint")          if(options[:o].present?) # Add all objects            stop_places = referential.stop_areas.stop_place.sort_by(&:name) -          Chouette::Kml::StopAreaExporter.save( stop_areas, temp_dir, kml_export, "StopPlace") +          Chouette::Kml::StopAreaExporter.save( stop_places, temp_dir, kml_export, "StopPlace")            itls = referential.stop_areas.itl.sort_by(&:name) -          Chouette::Kml::StopAreaExporter.save( stop_areas, temp_dir, kml_export, "ITL") +          Chouette::Kml::StopAreaExporter.save( itls, temp_dir, kml_export, "ITL")            connection_links = referential.connection_links.sort_by(&:name)            Chouette::Kml::ConnectionLinkExporter.save( connection_links, temp_dir, kml_export) diff --git a/spec/exporters/chouette/kml/exporter_spec.rb b/spec/exporters/chouette/kml/exporter_spec.rb index dd7c44327..a1d33613d 100644 --- a/spec/exporters/chouette/kml/exporter_spec.rb +++ b/spec/exporters/chouette/kml/exporter_spec.rb @@ -19,37 +19,40 @@ describe Chouette::Kml::Exporter do    let!(:line) { Factory(:line_with_stop_areas_having_parent) }    let!(:line2) { Factory(:line_with_stop_areas_having_parent) } -  describe "#export" do     -    before(:each) do  +  describe "#export" do +    before(:each) do        Dir.mkdir( tmp_path) unless File.directory?( tmp_path)        Dir.mkdir( exports_path) unless File.directory?( exports_path)      end      it "should return a zip file with nothing inside with no objects in arguments" do -      subject.export(zip_file_path, {:export_id => 1, :o => "line"} )                    +      subject.export(zip_file_path, {:export_id => 1, :o => "line"} )        File.exists?(zip_file_path).should be_true +      ::Zip::ZipFile.open(zip_file_path) do |f| +        puts "f = #{f.inspect}" +      end        ::Zip::ZipFile.open(zip_file_path).size.should == 6      end      it "should return a zip file with 4 kml files" do -      subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id}" } )   +      subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id}" } )        File.exists?(zip_file_path).should be_true        ::Zip::ZipFile.open(zip_file_path).size.should == 4      end      it "should return a zip file with 6 kml files" do -      subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id},#{line2.id}" } )   +      subject.export(zip_file_path, {:export_id => 1, :o => "line", :id => "#{line.id},#{line2.id}" } )        File.exists?(zip_file_path).should be_true        ::Zip::ZipFile.open(zip_file_path).size.should == 6      end      it "should return a zip file with 6 kml files" do -      subject.export(zip_file_path, {:export_id => 1, :o => "", :id => "" } )   +      subject.export(zip_file_path, {:export_id => 1, :o => "", :id => "" } )        File.exists?(zip_file_path).should be_true        ::Zip::ZipFile.open(zip_file_path).size.should == 6      end -     -  end -                               + +   end +  end | 
