aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMichel Etienne2015-08-24 15:03:57 +0200
committerMichel Etienne2015-08-24 15:03:57 +0200
commitf310a9e5782bccf9f21129855af0774b256853f9 (patch)
tree5632f5dd458574fc46e465052316b34f91b5dc04 /spec
parenta8eff16982a5e9d87414b6ca908f855371b184ba (diff)
parentb76cda8e9ce414f666c51799d1665bf4d45f3049 (diff)
downloadchouette-core-f310a9e5782bccf9f21129855af0774b256853f9.tar.bz2
merge V3_0
Diffstat (limited to 'spec')
-rw-r--r--spec/models/export_task_spec.rb8
-rw-r--r--spec/models/gtfs_export_spec.rb39
2 files changed, 39 insertions, 8 deletions
diff --git a/spec/models/export_task_spec.rb b/spec/models/export_task_spec.rb
new file mode 100644
index 000000000..1a52a6175
--- /dev/null
+++ b/spec/models/export_task_spec.rb
@@ -0,0 +1,8 @@
+require 'spec_helper'
+
+describe ExportTask, :type => :model do
+
+ it { should_not validate_presence_of(:start_date) }
+ it { should_not validate_presence_of(:end_date) }
+
+end
diff --git a/spec/models/gtfs_export_spec.rb b/spec/models/gtfs_export_spec.rb
index a5e5d0335..6051497a7 100644
--- a/spec/models/gtfs_export_spec.rb
+++ b/spec/models/gtfs_export_spec.rb
@@ -1,10 +1,33 @@
-# require 'spec_helper'
+require 'spec_helper'
-# describe GtfsExport, :type => :model do
+describe GtfsExport, :type => :model do
-# describe '#export_options' do
-# subject { super().export_options }
-# it { is_expected.to include(:format => :gtfs) }
-# end
-
-# end
+ describe "#time_zone" do
+
+ context "when exported data are not StopAreas" do
+
+ before do
+ subject.references_type = "network"
+ end
+
+ it "should be mandatory" do
+ subject.should validate_presence_of(:time_zone)
+ end
+
+ end
+
+ context "when export data are StopArea" do
+
+ before do
+ subject.references_type = "stop_area"
+ end
+
+ it "should be mandatory" do
+ subject.should_not validate_presence_of(:time_zone)
+ end
+
+ end
+
+ end
+
+end