diff options
| author | Luc Donnet | 2013-07-05 17:17:49 +0200 |
|---|---|---|
| committer | Luc Donnet | 2013-07-05 17:17:49 +0200 |
| commit | e3aab2a4851eb84fa3993637e78cd4b21b04e1fa (patch) | |
| tree | 2b6586214d2d60ec96fef814b98ddee4bd8c292f /spec | |
| parent | eec54db17585f6c1e7354dcd8cf37749527071f1 (diff) | |
| download | chouette-core-e3aab2a4851eb84fa3993637e78cd4b21b04e1fa.tar.bz2 | |
Add kml export for lines network and company
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/exporters/chouette/kml/exporter_spec.rb | 28 | ||||
| -rw-r--r-- | spec/models/export_spec.rb | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/spec/exporters/chouette/kml/exporter_spec.rb b/spec/exporters/chouette/kml/exporter_spec.rb new file mode 100644 index 000000000..e83cc1ad6 --- /dev/null +++ b/spec/exporters/chouette/kml/exporter_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe Chouette::Kml::Exporter do + + subject { Chouette::Kml::Exporter.new } + + let(:zip_file_path) { "#{Rails.root}/tmp/exports/test.zip" } + let(:line) { Factory(:line_with_stop_areas_having_parent) } + + describe "#export" do + + it "should return a zip file with nothing inside with no objects in arguments" do + subject.export(zip_file_path, {} ) + File.exists?(zip_file_path).should be_true + puts ::Zip::ZipFile.open(zip_file_path).entries.inspect + ::Zip::ZipFile.open(zip_file_path).size.should == 0 + end + + it "should return a zip file with the kml of the line inside with a line in arguments" do + 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 + + end + + +end diff --git a/spec/models/export_spec.rb b/spec/models/export_spec.rb index 4d5556998..fb83236b0 100644 --- a/spec/models/export_spec.rb +++ b/spec/models/export_spec.rb @@ -46,7 +46,7 @@ describe Export do describe ".types" do it "should return available Export implementations" do - Export.types.should =~ %w{NeptuneExport CsvExport GtfsExport NetexExport} + Export.types.should =~ %w{NeptuneExport CsvExport GtfsExport NetexExport KmlExport} end end |
