diff options
| author | Luc Donnet | 2013-07-09 13:34:51 +0200 | 
|---|---|---|
| committer | Luc Donnet | 2013-07-09 13:34:51 +0200 | 
| commit | 65ac74812afc241dddd8f5c244ee9328b8997405 (patch) | |
| tree | d1a605338b4855f3b172d5aad6255a2d31107a20 /spec/exporters | |
| parent | 6c221ce1ba3acf736bdbe2980138078498f20b41 (diff) | |
| download | chouette-core-65ac74812afc241dddd8f5c244ee9328b8997405.tar.bz2 | |
Link export view with kml export
Diffstat (limited to 'spec/exporters')
| -rw-r--r-- | spec/exporters/chouette/kml/exporter_spec.rb | 29 | 
1 files changed, 20 insertions, 9 deletions
| diff --git a/spec/exporters/chouette/kml/exporter_spec.rb b/spec/exporters/chouette/kml/exporter_spec.rb index 5f2b30b82..f44e8f201 100644 --- a/spec/exporters/chouette/kml/exporter_spec.rb +++ b/spec/exporters/chouette/kml/exporter_spec.rb @@ -2,29 +2,40 @@ require 'spec_helper'  describe Chouette::Kml::Exporter do -  let(:referential) { Factory(:referential) } -  subject { Chouette::Kml::Exporter.new(referential) } +  # let(:referential) { Factory(:referential) } +  # subject { Chouette::Kml::Exporter.new(referential) } + +  # let(:zip_file_path) { "#{Rails.root}/tmp/exports/test.zip" } +  # let(:line) { +  #   referential.switch +  #   Factory(:line_with_stop_areas_having_parent) } + +  subject { Chouette::Kml::Exporter.new(first_referential) }    let(:zip_file_path) { "#{Rails.root}/tmp/exports/test.zip" } -  let(:line) { -    referential.switch -    Factory(:line_with_stop_areas_having_parent) } +  let!(:line) { Factory(:line_with_stop_areas_having_parent) } +  let!(:line2) { 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, {} )                    +      subject.export(zip_file_path, {:export_id => 1, :o => "line"} )                           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 +      ::Zip::ZipFile.open(zip_file_path).size.should == 6      end -    it "should return a zip file with the kml of the line inside with a line in arguments" do +    it "should return a zip file with 4 kml files" 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 +    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}" } )   +      File.exists?(zip_file_path).should be_true +      ::Zip::ZipFile.open(zip_file_path).size.should == 6 +    end +    end | 
